Today I present to you Takuzu, a little puzzle game available for Pharo.
Takuzu is game I proposed to implement during my internship where I’m discovering Bloc, the low-level graphic framework for Pharo 11. The goal of this internship is to create little games with some basic UI using Bloc and after “finishing” the first MineSweeper project (you can find here: https://github.com/Enzo-Demeulenaere/MineSweeper), I started working on this new project.
The name Takuzu is the original Japanese name for this puzzle that is also commonly called ‘Binary Sudoku’ as you fill a grid with 0s and 1s following only 3 rules :
> You can’t have more than 2 cells of the same value aligned.
> There must be as many 0 as 1 on each row and column.
> Rows and columns must be all different one to another.
I first discovered this game around last year when searching for mobile puzzle games when I saw ‘0h h1’ on the Google Play Store (but you can also play it here: https://0hh1.com) and I immediately loved the logic behind it and wondered how could I implement it, what are the algorithms that seem simple but yet hide some complex thinking.
For the UI, I decided to entirely follow the look of 0hh1 with simple red and blue cells on a dark gray background, nothing too creative. Then I had to use Bloc to draw the UI while also using Toplo to have a menu with some widgets and this I what I’ve got so far:
You can discover this project by executing this snippet in Pharo 11:
Metacello new
baseline:'Takuzu';
repository: 'github://Enzo-Demeulenaere/Takuzu:main';
load: 'core'
and launch the application by executing : Takuzu openWithMenuBar
When in the main menu, you can try some pre-loaded levels from size 4×4 to 12×12 in the ‘Levels’ menu or choose the ‘Random’ menu to play with some randomly generated 4×4 and 6×6 levels (but the grids aren’t so good as my generation algorithm isn’t perfect at all)
You can also find all the informations about the project on its GitHub page: https://github.com/Enzo-Demeulenaere/Takuzu
Feel free to give me any feedback about this game and enjoy discovering Takuzu !
Enzo Demeulenaere