Minh T. Nguyen

        "Enemy's Gate Is Down"
Search this site:

Minh Tri Nguyen Minh T. Nguyen enderminh Vietnamese nguyentriminh blog Visual Studio .NET Tips and Tricks Nguyễn Trí Minh
posts - 194, comments - 583, trackbacks - 117

Minh T. Nguyen's Sudoku3D

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

Minh T. Nguyen's Sudoku 3D

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 one. In the end, I’ve opted for a backtracking algorithm using a stack of intermediate steps that can be undone in conjunction with a 3D matrix of possible moves. Fun stuff.

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

posted on Monday, February 05, 2007 9:00 PM

Feedback

# re: Minh T. Nguyen's Sudoku3D

Forgive me if I'm stupidly overlooking something, but don't you just want an 8x8x8 Sudocube? The 8x8x8 Sudocube would have 4x4x4 sub-cubes, each one being 2x2x2. That way all the criteria still apply.

Basically a 2D Sudoku must be x*x by x*x and have x subboxes in each direction, each of which measures x by x.

A 3D Sudocube must be x*x*x by x*x*x by x*x*x and have x*x subboxes in each direction, each of which measures x by x by x.

Think about what I just said, and you will understand why it must be that way.

The smallest sudocube that meets these requirements is x = 2.

I realise 8x8x8 is much larger than your current algorithm allows, but that is the only way a real Sudocube will work.
2/7/2007 4:16 AM | Carl Kenner

# re: Minh T. Nguyen's Sudoku3D

Of course, I could go one better and make 4D Sudoku.
The requirements for 4D Sudoku are obviously that it must be x^4 by x^4 by x^4 by x^4, and must have x^3 subboxes in each direction, each of which measures x by x by x by x.

The smallest 4D Sudoku would therefore be 16x16x16x16 and have 8 subboxes in each direction, each one being 2x2x2x2.

Of course that is 65,536 squares in total. So it would take a lifetime to complete. Not to mention that you would have to use a hexadecimal digit 0-F in each box :-)

Some games just don't scale well to more dimensions.

Noughts and Crosses (Tic-Tac-Toe) on the other hand is an excellent game to play in multiple dimensions. I highly recommend 6 dimensional Noughts and Crosses (3x3x3x3x3x3). Obviously you play for a certain number of points rather than stopping when someone gets a line. It is great fun when I've played it with people. I haven't tried more than two players, but it would probably work just as well with 3 players.
2/7/2007 4:29 AM | Carl Kenner

# Random Updates for March 2007

3/3/2007 12:10 PM | Minh T. Nguyen

# Random Updates for March 2007

3/3/2007 12:18 PM | Minh T. Nguyen

# re: Minh T. Nguyen's Sudoku3D

If you want to try out something new in sudoku, try shendoku, using the sudoku rules but playing two people, one against the other, like battleshipps. They have a free version to download at http://www.shendoku.com/sample.pdf . Anything else they are bringing out or they are working on you can find at www.shendoku.com or at they´r blog www.shendoku.blogspot.com . Have fun, I am. I specially like one slogan I heard about Shendoku: SUDOKU is like masturbation (on your own)…. SHENDOKU is like sex (it takes two).
10/15/2007 4:49 PM | armando

# re: Minh T. Nguyen's Sudoku3D

thank you
2/13/2008 3:55 PM | evden eve nakliyat

# re: Minh T. Nguyen's Sudoku3D

thanksss
2/13/2008 3:56 PM | evden eve nakliyat

# re: Minh T. Nguyen's Sudoku3D

thankss
2/13/2008 3:59 PM | evden eve nakliyat

# re: Minh T. Nguyen's Sudoku3D

thank you
2/13/2008 4:00 PM | sohbet

# re: Minh T. Nguyen's Sudoku3D

thanksss
2/13/2008 4:00 PM | sohbet

# re: Minh T. Nguyen's Sudoku3D

thankss
2/13/2008 4:01 PM | chat

# re: Minh T. Nguyen's Sudoku3D

thank you
3/15/2008 1:27 AM | otopsi

# re: Minh T. Nguyen's Sudoku3D

good 3d
7/3/2008 8:55 AM | Picture frames

Post Comment

Title  
Name  
Url
Comment   
Enter the code you see: