NumbrixGenerator
Thursday, November 27th, 2008 | Programs
For more including Author's Notes download the eBook pages with this program's code listing.
If you enjoy Numbrix puzzles but aren’t satisfied with a measly one a day then this is for you. Generate unique numbrix puzzles on the fly for a moment’s distraction or generate a whole book of them to take with you. If you’re stuck on a puzzle in the paper and can’t wait for the solution to be printed the next day you can also solve puzzles with this program.
If you’ve never played a Numbrix now’s your chance to play this simple puzzle that is sure to make you feel like a genius.
What is a Numbrix?
Numbrix is a new puzzle created by Maryln Vos Savant and run weekly in the Parade magazine. Numbrix are simple and satisfying and require no arithmetic skills beyond needing to count.
In a numbrix the numbers starting at 1 count upward making a winding path through the grid, touching every square until they entire grid is filled. So for a 9×9 numbrix the numbers go from 1 to 81. From a square you can go 1 step in only the coordinal directions; up, down, left, or right. Diagonals are not allowed. At the start you only see only some of the squares have numbers. It is your job to fill in the rest.
How do I use the Numbrix Solver and Generator Program?
You can either type in your options with the keyboard or click with the mouse on any screen.
At the main menu you are given 3 options:
1) Play a random puzzle - With this option the computer will create a randomly generated numbrix for you to solve interactively. You will be timed so be as fast as you can. If you liked a particular puzzle you can get it by going to the directory where this program is run from and getting the last.txt file. Move it or rename it to prevent it from being overwritten the next time you play.
2) Solve a Numbrix – With this option you can type in a numbrix that you find online or in the newspaper and the computer will solve it for you.
3) Make a batch of puzzles – With this option you can generate a book full of numbrix puzzles at once. The initial settings will be the same for all, but keep in mind that a “random” type puzzle will be different with every one. Since time to generate varies and can take quite a while it may be a good idea to let the program run for a while. Files will be named by taking the base name you specify and adding a number after it. You can retrieve generated puzzles in the directory where this program is run.
How is this program’s puzzles different from numbrix puzzles in the paper?
At the time of this writing this program can make puzzles that are exactly like the numbrix puzzles in print, but allows for some significant departures from the traditional formula.
- Traditional numbrix puzzles are either 8×8 or 9×9. This program allows the creation of puzzles sized from 5×5 to 12×12 (for puzzles play in the game) or 30×30 (for puzzles generated in the batch command) and allows rectangular dimensions.
- Numbrix layout types in print have only so far been the “traditional”, donut, strawberry, and strawberry donut. This program adds an option for random layout. The random layout does maintain a quad symmetry for aesthetic purposes.
- Occasionally a generated puzzle will have more than one solution. In that case a square will be picked that will fix it, and quad symmetry will also be maintained. This technically breaks the layout rules, but usually doesn’t look too bad.
- Of course puzzles generated by this program are different because they are not made by Maryln Vos Savant by hand.
- At the moment there is no functionality for determining the challenge level of a puzzle.
Technical notes:
Occasionally generation of a puzzle will happen instantly, other times it may take considerably longer. The reason for this is that the path generator will occasionally get stuck. While technically it will eventually succeed if allowed to run this program tried to reduce generation time by timing the path generation and if it’s taking too long stop it and start over. It’s not the most robust solution, but generally speaking it works.
Numbrix Solver and Generator was written by Joe Larson
3 Comments to NumbrixGenerator
I really wish the comment section was more friendly to sharing generated numbrix puzzles. It’s possilbe, but it involves opening up the last.txt or the generated puzzle file, searching and replacing all double-spaces (” “) with a space and a period (” .”) and replacing all double-dashes (”–”) with a dash and a space (”- “) then copy and paste the puzzle between <tt><\tt> tags here.
I really like doing random puzzles, sometimes only for the aesthetic of the shape that pops up. But this one I found really difficult:
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . 4 | . . | . 2 | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . 9 | . . | . . | . . | . . | . . | .15 | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | .25 | .24 | .23 | .22 | .21 | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . . | .65 | . . | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | .43 | .48 | .61 | .62 | .69 | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | .37 | . . | . . | . . | . . | . . | .57 | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
| . . | . . | . . | .50 | . . | .52 | . . | . . | . . |
| . . | . . | . . | . . | . . | . . | . . | . . | . . |
+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+- - -+
You can use option 2 to enter this puzzle in and play it yourself.
December 14, 2008
Joe, I downloaded the numbrix game and installed it. I hope you plan to add more features to it and the user interface!
If you’re familiar with Web Sudoku Deluxe, it allows you to save puzzles and has puzzles numbered so that you can actually retrieve a puzzle that you’ve worked on before. It offers four levels of difficulty: Easy, Medium, Hard, and Evil. It also keeps statistics on the fastest times a particular level of puzzle was completed. The only thing I think it lacks is statistics on the number of puzzles completed (I know I must’ve completed at least a thousand!)
I purchased Web Sudoku Deluxe puzzle for about $12.95 and have gotten my money’s worth on it several times over. I hope you’re interested in developing a more refined version of your Numbrix generator for us Numbrix addicts! I’d buy it!
December 15, 2008
That’s an interesting proposition. I’d love to produce a commercial product. And if you’re happy with what I’ve written so far please feel free to press the donate button on the side bar.
There are a number of obstacles between this and a commercial product. First and foremost I have no idea how to implement some of the features you’re suggesting. If I gave myself 6 months to focus on it, maybe. I’m not sure where I stand as far as creative commons goes or whatnot, but I’m guessing as long as it’s a free app with a tip jar I’m safer from retributions than if I tried to sell it. And maybe I’ve got nothing to worry about, but who knows.
I like the feature of having a number describe the game. I thought about it when I was making this one, but decided against it, at the time, because I couldn’t quite wrap my head around it. But now that I’m thinking about it I think I might have and idea. However, I ankle deep in another project right now. I’ll see when I can get around to it.
Leave a comment
Subscribe
Support Cymon's Games
Recent Comments
- Joe on Beginner’s Programming Homework
- Joe on ArrowFighter
- Devin Watson on ArrowFighter
- Joe on ArrowFighter
- Devin Watson on ArrowFighter
- Ken on Numbrix
- Joe on Sean Howard and Procedural Generation
- ejoyzamora on After Numbrix



November 27, 2008