Skip to main content

Adventures in Polyomino Tiling

Recently I began working on a recreational programming project that unites several subjects I have been wanting to explore for many years: AI, GUI programming, certain mathematical problems, and the intellectual zen and stimulus of gamifying them. My experiences with computer games growing up were quite limited despite that our family was somewhat early to install a 'family computer' in the library in 1992, a 80286 loaner at first and then a late model 386 with a turbo button on the chassis that doubled the CPU freq from only 33 to a screaming fast 66 MHz. I attribute this to my family's traditionalist values. Whether these positively or negatively curtailed my proclivities and aptitudes for computer-based labor, I cannot say for sure. It is true that I did not waste months of my youth on low quality game time, but I've never been wont for abdicating my languid and wastrel temporal habits. I recall several days or even weeks of boredom, and I am sure I have even made up some of the deficit in recent years with several offerings of temporal squandering in low grade video game time: a burning of time against the relentless scourge and depression of real adult responsibility.

Though I've never had the patience for most serious video games, nor the dedication and care to accommodate any I do find interesting with necessary computing resources--I'm insufferably opinionated over the most tedious minutiae and seem to exist in a perpetual state of annoyance even, or especially, when it comes to 'entertainment'--I do remember the halcyon days of sneakernetting copies of simulation games from my friend's house on a 3.5" floppy disk and covertly installing them on our family computer. My brother also found free demos of doom and dark forces online that have got me on a 90's retro Star Wars game tear lately, so long as they work in dosbox or wine. But I greatly digress. The topic here is polyomino games, specifically a game format that is as captivating as it is simple: tetromino tiling.

I used to play ksirtet in the KDE 3 days, but they didn't port it to QT/KDE 4 and the replacement didn't have all of the configurable keyboard shortcuts that ksirtet had. Ksirtet added two features that meaningfully enhanced the gameplay in a way that lowered the threshold for the zen state: translating pieces to the left and right sides of the board, and showing a shadow (a projection) of the piece under the bottom of of the tile board. This allowed you to maintain constant focus on the existing tiling state while simultaneously processing everything else with peripheral sight.

This is my second attempt at reimplementing ksirtet, the first devolved rapidly into vapid, desultory digressions on generalized multidimensional polyomino tiling problems and algorithms. Fortunately, now that I'm older and less idealistic--more impatient, perhaps--I've made some progress. I can't claim much so far for myself as I copied the code directly from Jan Bodnar's excellent wxPython demo tutorial, for which he also has a parallel pyQT version. I'm still evaluating whether to continue with wxPython or not. The relative elegance of the GUI framework will hopefully matter little to me and I may make a change if it results in drastically simpler cross-platform dependencies.

Screenshot of pySirtet 0.1

pySirtet 0.1 in action. Version 0.1 is basically a refactor of the zetcode demo. I've made the code more pythonic, and defintely a little more justinesque.

If you are interested in the game, you can follow the development on GitHub. I have been moderately impressed with the quality of documentation

and good information (as stackoverflow Q&A's, for example) on wxPython online so far, so I may stay with wxPython for now, despite that Phoenix hasn't molted yet.