I'm proud of myself. I did my first Sudoku puzzle the other night. After doing it, I decided to create a solver in Microsoft Excel - I am a finance / Excel geek after all. It turned out to be pretty nifty (download here). The spreadsheet uses a combination of Excel formulas and Visual Basic code to solve the puzzle. And the VB code uses recursion to test various permissible permutations of unknown values. The performance is pretty good. Beginner puzzles are solved in a couple of seconds. Expert puzzles take a couple of minutes. I tried it out with Web Sudoku and it worked well.
Anyway, it was a fun, creative challenge. A nice distraction from the other stuff I have going on at work. And a good excuse to brush off some old programming skills and learn some new stuff in Excel. Glad to see I haven't lost all my old computer science knowledge.
Note: If you intend to use the solver, you'll need to have macros enabled in Excel. To do that, in Excel, go to Tools -> Macro -> Security and select medium security. That way, when you open spreadsheets that contain macros, you will be prompted whether you want to enable or disable them.
Subscribe to:
Post Comments (Atom)
2 comments:
For those of you who want to solve these puzzles the old-fashioned way, here is a link to some tips.
I just made a slight update to this file - to eliminate screen updating while it generates the solution. Seems to improve performance by about 50%. Download here if you're interested.
Post a Comment