Category Archives: Sudoku

NetSudoku Update

I’ve posted a new build of NetSudoku. A few new features to cover:

  • There is now a built-in puzzle generator, but it’s in a very early form. It takes about five minutes to generate a puzzle, mainly because I generate 100 of them and pick the hardest one. I’m working on a new system that will generate puzzles in the background and keep a few of each difficulty around between sessions so that you can get into a game quickly. Then, when you pick a new game it will have one available. This is all a work-in-progress, but I wanted to get this out there so that others could use it and see how well the generator builds puzzles.
  • The solver can now solve anything (was required to make a generator), including backtracks and guessing. The hint feature will still only display a single hint at a time though, and it will tell you if it had to guess to get the answer.

I think those are the highlights, enjoy!

Another NetSudoku Update

This version adds a few new features:

  • Load/Save Games
  • Restart Game (clears all selected numbers)
  • Create custom game
    This feature lets you place a custom grid into the game. You first select Game, Create and are presented with an empty grid. At that point, you place all the numbers for the grid. After you are done, you select Game, Create again (unchecking it) and the placed numbers are marked as givens. At that point, the game is ready for play (and available on the network if you have network support enabled).

Enjoy!

New NetSudoku Build Online

I just published a new build of NetSudoku. This version includes a number of new features:

  • Logic-based solver
    It’s not going to solve every puzzle yet, but it’s a step in that direction. It can be used in two modes, a complete solve and a hint. Note that the hint feature should only be used once all the candidates have been found (using Ctrl+F). Otherwise, you can get false cells and it will break. The solver automatically refreshes all candidates first so that’s not a problem there. The solver will output every technique it used to solve the puzzle, so you can see as you go along what logic is used to complete the puzzle. I’ll expand the methods of the solver later to include X-Wing, Swordfish and other variants to help with some of the trickier puzzles.
  • Grid Control Style Design
    I’ve enhanced the grid control using GDI+ to be more colorful and stylized. I think it looks good, but I’m open to suggestions.
  • Threading Engine Changed
    The method I was using threads before was causing a lot of delays in the networking code. I was also recreating some objects way too often, adding to the network lag. I rewrote the threading code to be more responsive to user actions. This should result in smoother network game play.
  • Settings Saved
    When exiting the game, all user settings are stored. This includes the window positions, network and chat windows, and a few other things. It also includes all of the colors used in the game. At some point, I’ll probably add a UI to change some of the colors for those that don’t like the default settings. For you advanced folks, feel free to tweak the settings to your liking.
  • Smart Cell Population
    In the previous version, if you had several folks hammering to plug that last few cells of a puzzle, you could end up clearing cells since others were setting it at the same time. I’ve put some logic in to hopefully prevent the cells from being cleared if multiple players had the same intentions.

Those are the highlights, I’m sure there are a few bug fixes or something thrown in as well.

Things that are still being developed include a Skype network layer (which is partially done, but disabled in this release since it is still very incomplete), the ability to pull games from popular RSS feeds, the option to create a custom game board (for entering puzzles you want to do as a group). I’m also still finding new things to try out in the .NET 2.0 runtime, so who knows what else might show up.

If you already have installed NetSudoku, the application should update automatically through ClickOnce. If you have not yet installed NetSudoku, you can install it from here (note, using IE makes the installation the easiest, so close FireFox and use IE for the best installation experience — then go back to FireFox).

What’s in a name? NetSudoku…

Well, it seems somebody has finally put up a page on NetSudoku.com, certainly not related to my Sudoku game. I’m sure at some point I’m going to have to come up with a better name for the program…

Bah I say!

NetSudoku Updated

I’ve released a new version of NetSudoku. This version includes a complete rewrite of the networking layer. It still uses multicast, but the new extensions are going to set me up to enable some gateway options including the use of Skype AP2AP for connecting to other players via Skype.

This version also offers some improved candidate removal and conflict detection. I’ve implemented a house-based algorithm for the cells to allow changes to propogate through the grid based on relationships to other cells. It’s the start of some new ideas that I have for the game, so more to come on that later. The game now indicates invalid candidates in a dark gray color so that you can see if you place a candidate that cannot possibly go in that cell.
I’ve also added a network view to the right portion of the window. This window lists all the games being played and which players are in each game. You can jump between games with ease (as long as at least one person keeps playing a game it will stick around) to find one that suits you. The chat window also now has syntax coloring and formatting (using RichTextBox) so that it will be easier to distinguish between the various message types and who sent them.

There are still more improvements to come, including a list that shows who changed each cell in order. Still working on that, as well as some dynamic cell tool tips (to show who placed that number, etc.). I’m also looking at adding some nice dynamic features like the ability to pull the daily puzzles from various web sites that offer them to Sudoku clients.

Enjoy!

NetSudoku Updated, Multiplayer Added

I’ve published a new version of NetSudoku. This latest release includes multiplayer support. You can install the application here (be sure to use IE to enable ClickOnce deployment for automatic updates).

If you are on a network, you can click Network->Enabled to make your game visible on the network. At that point, other players can click Network->Join Game to find your game. At this point, it joins the first game that responds. Later I’ll add the ability to pick from a list of received games before actually joining the game.

The multiplayer support uses multicast datagrams, so there are no connections required. When you join a game, you actually become a host of that game. As moves are made, they are multicasted out to the other people playing the same game (all games have a unique identifier on the network). At any time, players can leave and join the game without any interruptions. If all players leave the game, the game no longer exists on the network and cannot be continued.

There is currently no timing and all moves are cooperative towards solving the puzzle. This mode prevents people from getting into a number rush and let’s players enjoy the game at a slower pace (particularly for the harder puzzles). I’ll probably add competitive play later, including timed games and a scoring system based on the difficulty of the move (naked singles one point, hidden quads a lot higher).

I’m sure there are still bugs as this is an early work in progress, but several of us have had it up and running for a few hours without any major snafus.

Oh, you can also chat with everyone else playing the game when networking is enabled so that’s fun.

NetSudoku, My Implementation of Sudoku for Windows

I wrote a long time ago about how I’m addicted to Sudoku. It all started when I found the site WebSudoku last year. Well, I’ve enjoyed progressing through various levels of puzzles and learning many advanced techniques for solving these crazy grids. Over this time, I’ve found the web-based format of the game limiting. Therefore, I tried to find a really good “digital paper” version to work the puzzles. I wanted to be able to mark numbers in the squares, quickly find hidden pairs and triples and mark them with various colors to work out snakes and such.

In the end, I found nothing that really met my personal needs. So, being a software engineer, I decided to write my own. The result is NetSudoku, a C# implementation of Sudoku for Windows. The application currently allows the user to mark canditates (including the somewhat evil auto-candidates) and work the puzzle to completion. As numbers are entered, now invalid candidates are removed from the grid. I tried to avoid putting too much logic into it, but if you get an easy puzzle, it will basically solve it for you if there are enough cells with only a single valid candidate. But easy puzzles are boring unless you’re in a speed mode trying to do 4 minute or less grids.

The application uses .NET 2.0, so you must have the runtime installed to play it. I also setup the application to be delivered via ClickOnce so updates are automatically patched as I make them available. At this point, the application is in the very early stages and will likely see some major changes as I add the multiplayer options (another reason I wrote it). With harder puzzles, it’s sometimes fun for several folks to mull it over at once to obtain a solution and my goal is to make it offer a collaborative (as well as some competitive) mode of play to meet this requirement.

You are welcome to try out the application, I’m making it freely available to those that care to play it. No support is offered at this time, but feel free to comment on the application itself. I won’t ignore any feature requests either, but I can’t guarantee I’ll put them into the code. At some point, I’ll likely publish the source code for others to learn from and possibly extend on their own.

You can read more about and install the application from here: NetSudoku.