Friday, November 23, 2007

Sudoku Dictionary

Since I wasn't making headway on the rest of my "Ultimate Sudoku Solver" program, I decided to pursue the idea of creating a Sudoku dictionary that I had mentioned previously. Solving a Sudoku puzzle can be, in a lot of ways, similar to cracking a password-- so why not create a dictionary of all the possible number combinations that can be in a row or column, and then use something like regular expressions to quickly narrow the range of possibilities a bit.

So, I decided to create my Sudoku dictionary. Manually. It wasn't actually as bad as it sounds. It took about three hours, but there were patterns that developed which allowed me to make good use of Find & Replace and Copy & Paste. [It would have taken even less time if I were actually a TextWrangler power user, instead of a tyro.] With each milestone I reached, the progress jumped dramatically. 24 replacements made . . . 720 replacements made. 350KB became 800 KB. By the time I was done, I had a 3.4 MB plain text file that contains all the possible legal values (note: 362880, to be precise) for one row or column in a Sudoku puzzle.

Now, erm . . . where can I post it? LMAO.

My first thought was Google Docs, but it's a bit too large for that as a text file-- or even as a spreadsheet. I'd like to share it with others, much like I've done with the solution checker, but unless I divide it into segments I don't have anywhere I can post it reliably.