Subscribe via RSS Become a friend on Facebook Follow me on Twitter

Cymons Games


November 27th, 2008

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 Marilyn 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.

28 Responses to “NumbrixGenerator”

  1. ChristyG

    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!

  2. Joe

    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.

  3. Joe

    I’ve updated the program with a code feature. When a puzzle is generated, along with it you get a code that you can type in to get the same puzzle again and that you can use to share numbrix puzzles with others.

    Here’s one to try:
    That one is probably the hardest numbrix I’ve ever seen and, yes, it’s got a single unique solution. It goes to show that numbrix CAN be hard.

  4. Joe

    I’ve updated the code one more time. Bug fixes and now when instead of adding givens to insure uniqueness, it deletes and old one at the same time. “Original”s now only rarely stay in their original configuration, but I like it better than filling up the board with more hints.

    Besides, all I ever do are random ones anyways.

    You can still share your puzzle codes so that others can play the good puzzles you generate. Post your codes here or in the forum.

    So go download the newest version.

  5. Mary

    do you have any printable numbrix games?

  6. Joe

    Download the program. Run option 3, let it generate how ever many you want all night long, and print out the text files it generates in the morning.

  7. John

    I’m a math teacher and have been using your generator to create puzzles to challenge my students with. I just downloaded your latest version wanting to use your code feature. In particular, I have student running through puzzles like they aren’t any challenge at all and I would like to see how she does on the difficult one you mentioned above (0909051232147254). Trouble is that I can’t seem to find a place to enter the code. What am I doing wrong?

    Thanks for making this available. It is helping me in my classroom and is a lot of fun besides.

  8. John

    Ok, just discovered that the code feature only works when you are playing the game on-screen. So, never mind my question. Thanks

  9. Joe

    It works if you’re using the “generate puzzle” options, which does let you play it on screen, but after that if you go to the directory where you have the program and open the “last.txt” file you will have the puzzle ready for print too, so you can use that one. Give it a shot.

    I’m so excited you’re challenging your math students. That’s pretty much what I had in mind when I wrote it.

    And, Numbrix aren’t hard. They really aren’t. If you haven’t seen it already I have a couple of videos of me speed solving the daily Numbrix puzzles. Check them out.

  10. Bruce

    And it should be noted that one could use an even-numbered matrix to force blank spaces, though it’s not clear that this increases difficulty any. I think there are a couple of ways of boosting the difficulty here (and you should be able to provide these options in your program). The first of these is to print only the ‘exit’ numbers. The catch here is that the unilinear path must travel through all the boxes inside the matrix in an orthogonal manner once and only once and cannot cross itself or leave the “box” directly above the matrix, but need not necessarily pass through all the boxes external to the matrix.

    44 1 8
    x x x x x x
    x x x x x x 15
    x x x x x x
    x x x x x x 25
    59 x x x x x x
    x x x x x x 29
    55 35

    The most challenging version would be to substitute numbers for arrows, leaving all other rules the same. Puzzle solvers therefore need to determine not only the proper path, but suss out which of many directions to go. Thus, the same puzzle (above) would look like this:

    x ^ x ^ x x
    x x x x x >
    x x x x x x
    x x x x x >
    End x x x x x x
    x V x V x >

    Please let me know if you do program these options. Of course, once you have a unilinear progression, you can substitute almost any logical, linear pattern for the numbers… the Fibonacci sequence, or words in a Shakesperean quote, say. In both cases, the challenge is slightly increased by requiring the puzzle-solver to start by determining the right pattern before proceeding to determine the proper path. This lends itself to inclusion of any number of red herrings as one might choose patterns, the ambiguity of which is itself resolved by the discovery of the unilinear path.

    Looking forward to seeing what changes you make!

  11. Bruce

    Apologies for the ASCII puzzle. Here’s a clearer version that substitutes ‘y’s for the blanks

    y y 44 1 8 y y y
    y x x x x x x y
    y x x x x x x 15
    y x x x x x x y
    y x x x x x x 25
    59 x x x x x x y
    y x x x x x x 29
    y 55 y 35 y y y y

    y y y Strt y y y y
    y x ^ x ^ x x y
    y x x x x x > y
    y x x x x x x y
    y x x x x x > y
    Ed y
    y y y y y y y y

  12. Bruce

    Oh, I give up with the ASCII. :P Hopefully you get the idea.

  13. Joe

    Yeah, sorry about that. It’s impossible to get wordpress comments to do ASCII very well, as far as I know. The forum is much better for that, just use code tags.

    Those are excellent suggestions, tho now you’re talking about a completely new puzzle, not numbrix, and I’ll be that they’ll work on odd grids too. However, I’m not sure if they would increase difficulty, I think a few test cases would be in order. Crack out the grid paper and maybe you could have the next puzzle sensation on you hands there.

  14. Dawn

    I have a Mac and an ipod touch…any chance your generator will be available for them soon?

  15. Joe

    … Heck of an idea there. Unfortunately I’m only $1000 dollars away from even starting that idea as I don’t have a mac or an ipod touch. I wonder if I started a collection would I be able to raise enough.

  16. tred

    any chance that the grid can be resizeable similar to the soduko portable game for us with older eyes? Lupo PenSuite for usb flash drives also has resizeable screens in the portable games section. btw this numbrix would fit in with their selection of puzzle games nicely, no idea if any of their source is open tho.
    also would it be possible to just click a square and scroll the numbers then click again? i frequently am reclined away from the keyboard and mouse-only input would be nice
    just a few odd ideas, thx for the efforts

  17. Joe

    There is a way to make the size larger: right mouse click on the top bar, choose properties, and choose a bigger font. This is a console app, which means it’s low on sophistication, but high on cross-platform compatibility. Good input options, but it gets a bit hairy when you start doing 10x10s or 12x12s and have 132 numbers to enter. I suppose i could figure something out, tho. I’ve been considering what touch options I’d do for an iPhone app, tho that may be a little ways off yet. Something about clicking and dragging through previous numbers, indicating up or down. That way you could just drag around the whole field.

    Thanks for the link to portable app, good site there. However, I’ve got my laptop, so most of my portable apps are portable because of the system they’re loaded on. Tho I wonder if there’s a portable Code::Blocks?

  18. Sue

    Does your game work on a Mac? I am a numbrix addict! Thanks!

  19. Joe

    Yes and no. It should compile fine on a mac, but being as I don’t have a mac I can’t provide binaries for you all. If anyone has a mac I have a version of this program which has been re-formatted, color wise, to work better. (Had to do so when I ported it to Linux.)

  20. limeyguru

    I’m hooked.

    btw, I’m sure Marilyn vos Savant would appreciate it if you spelled her name correctly!

  21. Joe

    Oops, sorry about that. Thanks for the correction.

  22. Patti and Duane

    We are hooked and have competitions with each other. We are senior citizens. Thanks for helping to keep our brains alive!!!!!

  23. Ravi

    I invented a family of logic puzzles couple of years ago, and recently heard about the Numbrix puzzle. I can imagine that the Numbrix could belong the “family” of puzzles I am talking about. I have decided to create iphone and ipod applications of my games, and also a website ( where people can play and download games. Please let me know if you have any interest, I will post back to this forum (or to you if you send a message to when the iphone apps and the website opens up.

    I was going to do some work to extend what Cymon has already done, but thought a more extensive website/app would be more enjoyable to the readers.

    The app will be free to all who respond to

    I would love for Cymon and others to comment on the games.

    (Sorry about what might look like a commercial message, but it is not. The games will be free. I am providing them as a service.)

  24. Ravi

    Hi Bruce:

    Saw your post here, but did not fully understand your proposal. I have a “directional” puzzle game that I have programmed and will be publishing soon as an app plus on the web. If you are interested, let me know.

  25. Umang

    AWESOME. WOw. :O
    Great work.

  26. Phil

    Nice program. If you are looking for options for the next version, I would like to see 6 (2×3) puzzles printed on a page in the same size as the current printed solutions. A second page would contain the solutions in their current format. I am currently importing files into Excel to accomplish the same. Thanks for the fun!

  27. Zackary Wendel

    Hi Shaurn just took the frist steps,thank you

  28. leon

    I have fallen in love with Hidato, very similar to Numbrix except in Hidato the numbers can connect diagonally. As a programmer myself I am very impressed with your product, very well done friend.

Leave a Reply

Cymons Games. All programs provided without guarantee or warranty. Maintained by Joseph Larson.
If you have any questions or notice something is wrong please contact me. Powered by WordPress.