Simon Tatham’s Net Puzzle in 3D (raylib)

I have Simon Tatham’s portable puzzle collection on just about every device I own, its ideal to fill the odd five minutes and highly recommended! As a homage to my favourite, net puzzle I gave it the 3D treatment with raylib.

I hacked out just the clever bits from the source, and as its a hack if it behaves in any way oddly its entirely my fault! That said the code was a pleasure to work with, which sadly is a refreshing and pleasant surprise…

While stumbling my way through just how the code allocates and uses memory, I found that GCC’s instrumentation was very helpful, its even helped me find some difficult to spot issues within raylib in the past, here’s the options I use when making a debug build

INSTR:= -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined

Adding these to your debug flags, will very often mean you won’t need to step through code in a debugger (never my favourite process!)

I threw in a very simple button implementation I’d previously made, to allow parameters for a new game to be selected, when the game starts it creates a large game and solves it, making a nice background while you decide on the game settings…

Probably due to the quality code in net puzzle, it only took a few hacking sessions to create a 2d raylib version of net puzzle, about the same time it took to turn it 3d and add the menu…

Hope you enjoy it, the source code to make your own executable is here


Leave a Reply

Your email address will not be published. Required fields are marked *