Sunday, March 1, 2009

Sudoku in Silverlight

You know how it is, you learn a skill (Programming in my case) because you see the results of others. Looking at the fruits of their labors, you say, "wow! I want to be able to do that." So you start learning, take some classes, read some books, maybe like me you enroll in the Computer Science program. If you get good, you may even get a job using your new found skill. But, did the learning of this skill lead you to the place you wanted to be, all those long years ago?

When I first started programming, it was to automate the games I was already playing. Then I moved into trying to replicate the types of games that I had played before on the computer. But as it usually happens, the real world got in the way. Instead of learning how to animate sprites, I had to learn how to connect to a database. Instead of graphics, I had to learn about algorithms.

Now, I'm not knocking my job and the work I do. I rarely go to "Work" since I get to indulge in my passion for programming every day. But, I feel this need to give more than lip service to the original reason that I got into the "Biz" in the first place.

Believe me, in 25 years the landscape of game programming has changed so much that I hardly recognize it! And, I've tried to keep my feet wet in the technology the entire time. The time when the ability to draw a digital stick figure and write a great game around it (Lode Runner) is long gone. When I first made up my mind to bite the bullet and truly try to learn game programming, in depth, the technology seemed so complicated that I almost quit.

But Rome was not built in a day and neither were any of my favorite games. Like I tell all of my junior programmers, "Start at the beginning, then just program each little piece until it is done”, I decided to start with the smallest bite I could “chew” and then just keep going. The first "Game" I wrote was a Sudoku generator with a Javascript back end. I Wrapped a website around it and launched it a couple of years ago.

Well, here is the thing about games, the are not all created equal. Sure Sudoku is a "Game" per se, but not really related to my true love, boardgames. So http://www.freedailygames.net languished for a few years without any upkeep. I even thought of just shutting it down, but according to Google analytics, I have a few very loyal customers. And, now with the new technology of Silverlight, I thought that updating my site with a Silverlight implementation of Sudoku would help me build my skills and give freedailygames.net a tech boost.

Well, here is my take on Sudoku in Silverlight.



And here is a zip file containing the entire Visual Studio 2008 Project.

7 comments:

Anonymous said...

Yo! You are cool! Did you beat The Deep Blue in chess?

Anonymous said...

I like... but there are some problems. If you start a new game it doesn't recognize the solution. Pressing "solve" actually changes the grayed out squares also! I don't know if it's reverting back to a previous puzzle or not.

Lee Saunders said...

Good catch! I'll bet its in my async code. It seems that I'm loading the previous pages' puzzle, then loading the new puzzle into memory.

Everyone, I'll try to get a fix up this week.

Lee Saunders said...

Well, I fixed the code by just ripping out the async code for the new game splash page.

Now I just alter the cursor while I generate a new puzzle.

Code has been updated as well.

John said...

Hi Lee, If found your Sudoku game on silverlight.net and I put a slightly modified version of your game on myosity.com.

Lee Saunders said...

John,

Well, I posted the code so it could be used!

Thanks for acrediting me by name, but could it also be possible to include a link back to this blog?

Lee

Rishi said...

Have a look at my post
iPhone Sudoku in Silverlight using MVVM
, where I've used your game engine. Hope you like it..

Also, it seems there is no direct way of contacting you from your blog - maybe you provide some kind of form or an e-mail address. Cheers.