October 2011
2 posts
Procedurally Generating Images in the Style of...
Introduction Piet Mondrian was a Dutch painter. His paintings with orthogonal lines and rectangular splashes of primary colors on white backgrounds are very recognizable. I wondered what it would take to programmatically generate Mondrian-esque images. Here’s what I came up with. The Algorithm The algorithm operates on a two-dimensional grid. Initially, the grid is empty (white or...
Oct 26th
5 notes
Ricochet Robot
My friend introduced me to a board game called Ricochet Robot (or Rasende Roboter in its original German form). It’s a fun game, but I found it even more fun as a programming problem. I implemented the game in Python, including a user interface and a solver. After that, I sped up the solver tremendously by porting it to C. The Rules The board is a 16x16 grid. It is made up of 4...
Oct 3rd
3 notes