# Minh T. Nguyen's Sudoku3D in XAML

I’ve already played with XAML almost a year ago when it was still in the early stages, but over my winter break, I spent some time getting my hands dirty with the 3D aspects of Microsoft’s XAML/Windows Presentation Framework. I decided to create a 3D version of the famous Japanese Sudoku game, and pretty much finished coding 90% of it already in December 2006, but it’s not until today that I finally found the time to wrap up the code, the user interface and fix all the pending bugs.

So, here it is: Minh T. Nguyen’s Sudoku3D

The Game

Just like in regular Sudoku, you need to fill in a row, column and “height column” of the cube with all natural numbers, so that each number appears once and only once. Unfortunately, the third rule of Sudoku (that a given 3x3 sub-square of a 9x9 Sudoku square contains all 9 numbers) does not translate into the third dimension. For instance, in a 4x4x4 Sudoku cube the 2x2x2 sub-cube has eight cells, not four. I therefore had to get rid of the third rule, which makes playing this game not as fun as I expected it to be. If anyone has any insightful suggestions on how to translate the third Sudoku rule into the third dimension, let me know.

Requirements

This game requires Internet Explorer as well as the Microsoft .NET 3.0 (which comes pre-installed with Windows Vista but is available as a separate download for other Windows systems). A fast and powerful computer running Windows Vista is preferred, as the Sudoku generation for large cubes can be very CPU-consuming (in fact, I don’t even allow you to generate cubes larger than 5x5x5 even though it’s theoretically possible). In addition, the graphics just looks much smoother on Vista since 3D anti-aliasing is only enabled there.

Development

Coding this game has been pretty fun. The hardest part of this all was actually not the 3D aspects of this, but the Sudoku generation algorithm itself. I never realized that creating a valid Sudoku is actually much harder than solving it. In the end, I’ve designed a backtracking algorithm using a stack of intermediate steps in conjunction with a 3D array of possible moves. Fun stuff.

Hope you all will enjoy playing this game as much as I enjoyed coding it!