Ever since becoming a Dad, I have enjoyed creating paper-based games and puzzles for my son. I began with mazes, starting with hand-drawn ones and later moving on to computer-generated ones. As he got older, he became interested in Sudokus, albeit the easier ones since he was only six years old at the time. More recently, he has discovered word searches and kriss-kross puzzles.
To make it easier for my son (and others) to access these puzzles, I decided to create a website to host them all. And that’s how NinjaPuzzles.com came into existence.
The Technology Behind NinjaPuzzles
NinjaPuzzles is a static website built using Jekyll as the content management system (CMS). To create the puzzles themselves, I use PHP scripts.
Mazes
The mazes on NinjaPuzzles are created using the same PHP script I used when publishing them on Twitter a couple of years ago. This script generates random mazes with various difficulty levels.
Word Searches
For word searches, I started with a PHP script that was generated by ChatGPT—an AI language model. However, I made significant modifications to this script to ensure more random layouts for the word search grids. The word lists for each puzzle are stored in text files.
To add new word searches to NinjaPuzzles, all I have to do is create a new file with the list of words and run the PHP script. It automatically generates the PDFs, images, and markdown content required for displaying the puzzle on the website.
Kriss-Kross Puzzles
Similar to word searches, kriss-kross puzzles were also created using a ChatGPT app as a starting point. Again, some modifications were necessary to achieve optimal designs that allow easy distinction between different word regions within the grid.
The hardest part to build was the design of the grid. Ensuring players could easily tell where the different words started and ended was a challenge that required a lot of trial and error. I’m pleased with the final design - I feel like it looks like it was the only possible layout, but it took a few attempts to get there.
Like the word searches the kriss-kross puzzles are generated using a PHP script. The word lists are stored in text files, and the script generates the PDFs, images, and markdown content for the website. Currently there’s only 5 kriss-kross puzzles on NinjaPuzzles, but I will be adding a lot more very soon.
Sudokus
Creating sudokus was the quickest process. The majority of the code for generating these puzzles was written by ChatGPT, with my main involvement being in the design aspect. To ensure solvability, I also developed a Javascript sudoku solver so that users can find the solutions.
However I also decided to create mini sudokus. These are sudokus that are on a 4x4 grid rather than the traditional 9x9 grid. Making these work was a bit more effort since I had to modify all of the hard coded properties from the original puzzle generator. Now that this has been done I should be able to easily add more types of sudokus in the future - maybe a 6x6 grid?
I also need to update the solver to work with the new size. Currently it only works with 9x9 sudokus.
Making Puzzle Downloads Quick and Consistent
To generate PDFs for puzzle downloads on NinjaPuzzles, I rely on MPDF — a PHP library that simplifies PDF creation. I have created generic templates and methods that enable quick and consistent designs for all of the puzzles.
Future Plans for NinjaPuzzles
NinjaPuzzles is still in its early stages, but I plan to continuously add new puzzle downloads to the website. My aim is to provide a variety of engaging and challenging puzzles for kids (and adults) to enjoy.
Creating NinjaPuzzles has been an exciting and rewarding journey so far. It allows me to combine my love for creating puzzles with my passion for web development. If you’re looking for fun and educational activities to keep your little ninjas entertained, be sure to check out NinjaPuzzles.com.
Stay tuned for more updates as I continue expanding the collection of brain-teasing adventures on NinjaPuzzles!
Was it good/ useful/ a load of old rubbish? Let me know on Mastodon, or BlueSky (or Twitter X if you must).
Link to this page
Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.