Sudoku Cheater: My First iPhone Widget (3)
Last year while flying to the west coast I finally got around to learning how to play Sudoku. Thanks to the folks at Attaché Magazine and an unknown passenger previously seated in 11B who partially completed the puzzle before me, I was able to pick up the rules pretty quickly. Thus began my short lived fascination with the Japanese number game.
On my trip back to Pittsburgh I picked up a book filled with Sudoku puzzles to keep me occupied. By the time the flight attendants were serving beverages I was already imagining more interesting uses for the sheets of paper in the book. (Folding and throwing paper airplanes on an airplane is loads of recursive fun!)
The problem I have with Sudoku is that it’s only enjoyable the first few times that you play it. After playing a handful of games you quickly realize that every game is essentially the same. When you’re doing Sudoku you’re not so much playing a game as you are acting out an algorithm. After playing five games you get into a routine. After playing ten games your brain begins to numb itself to outside stimuli as it morphs into a slow, organic Sudoku solving machine. If you manage to solve one hundred puzzles in a row you’ll find yourself completely transformed into an oil sipping, Daft Punk listening, Sudoku solving robot. You’ll go crazy spotting Sudoku puzzles in the world around you. Phone numbers will begin to resemble Sudoku rows and you’ll catch yourself searching for the missing digit. It’s no way to live.
Although the act of playing Sudoku now bores me, I thought it would be fun to write a software application that solved the puzzles automatically. Nearly twelve months later, I finally got around to building it. The current version is implemented as an iPhone widget, although I plan on eventually developing another version that’s better suited for a typical web browser. I figured that an iPhone widget would be the most useful version as many people like to play Sudoku during their bus or train ride to work. More importantly, I was looking for an excuse to build my first iPhone widget and this seemed as good a reason as any.
If you have an iPhone or iPod Touch, navigate your way to http://www.sudokucheater.com/iphone. When I initially wrote this widget I had it perform all of the calculations on the client side within the iPhone itself. Unfortunately the iPhone’s processor isn’t fast enough to handle complex Sudoku puzzles and it was causing my iPod Touch to give up after five seconds of thinking. The current version performs the calculations on the server side which means that even the most complex Sudoku puzzle can be solved in a fraction of a second. In fact, the Ajax communication takes longer to send and receive than it takes my beefy XServe to actually solve the puzzle.
I plan on turning this application into a case study for some of the training that I conduct. The application employs a Java Servlet, JavaScript, HTML, CSS and Ajax which makes it a good candidate for study in many of my corporate training courses. Once the software is a little better tested and documented I plan on releasing the code for examination. Until then I’m eager to hear your feedback on my first iPhone widget.
Well that was fast. Apple has already included this widget on their list of iPhone web apps.



Maybe the problem with your Sudoku experience is that you were trying to solve it the same way as your widget - brute force.
If you peruse the forums at Pappocom (the folks who originally ran Sudoku in the Washington Post here), there are purists who solve them entirely by logical patterns, and their methods make sense - if you can decipher their nerdy explanations!
It seems to work just fine in firefox. No iPhone required…
Wow, it’s amazing how far sudoku has spread in just a few years… now you have a cheat for the iphone. It’s cool, and crazy!