Click or drag transformation functions into your program to reshape the cubes into the goal pattern. Press R to reset and N for the next level. Best played on a desktop or laptop.
Cube Composer is a puzzle game inspired by functional programming, created by developer David Peter (sharkdp). Each level presents a starting stack of colored cubes and a goal arrangement, and your job is to compose a short program of transformation functions that turns one into the other. The functions are small and visual, things like "map yellow cubes to red", "stack", or "reject yellow", and they run one after another from left to right, with the output of each becoming the input of the next. That is the central idea of function composition, presented as a hands-on toy rather than a lecture. There is no typing and no syntax to learn, just the satisfying click of snapping functions together until the cubes line up with the goal. The difficulty ramps up gently across dozens of levels, making it a friendly introduction to thinking like a programmer. Cube Composer is released under the MIT License, which is what lets PlayBrain self-host the original open-source build for you to play here.
Credits: Cube Composer by David Peter (sharkdp), released under the MIT License. Source: github.com/sharkdp/cube-composer