Cube Composer - Play Free Online | Wipzu
About Cube Composer
Cube Composer is a browser puzzle game inspired by functional programming, written in PureScript by developer David Peter. Each puzzle presents a starting row of colored cube stacks on the left and a target arrangement on the right. Your task is to build a pipeline of transformation functions — select them from the available palette, arrange them in sequence — that converts the start state into the target. The only way to solve a puzzle is to understand what the functions actually do.
The transformations map directly to functional programming concepts. Color-replacement functions work like a map operation. Filter-style functions remove all cubes of a specified color from every column. Stack functions append a new cube on top of every column. Composition tools chain multiple transformations together so the output of one becomes the input of the next. Each function has a visual icon making its behavior readable without prior coding knowledge.
Early chapters introduce one or two transformations and give you room to experiment with each. By the middle chapters, correct solutions require four or five functions chained in precise order — and the order matters fundamentally. Applying a filter before a color replacement gives a completely different result than the reverse. This is the same behavior as real function composition in Haskell or Elm, expressed entirely visually.
With six chapters and puzzles categorized Easy through Hard, Cube Composer covers a surprising range of functional concepts without ever asking you to write code. Developers who already know functional programming will immediately recognize the patterns. For everyone else, it works as a pure logic puzzle game where the satisfaction of solving a hard level is completely genuine.
Key Features
- Six chapters of puzzles spanning Easy, Medium, and Hard difficulty — over 40 puzzles total
- Pipeline-based solving: arrange transformation functions in sequence, where the output of each feeds directly into the next
- Real-time preview updates instantly as you add, reorder, or remove any function from the pipeline
- Transformation functions map to real functional programming concepts: color replacement (map), color removal (filter), column appending (stack), and chaining (compose)
- Built in PureScript — a purely functional language — making the game a live demonstration of the concepts it teaches
- Open-source on GitHub (sharkdp/cube-composer) with community-contributed puzzle chapters
Controls
How to Play
- 1Study the starting cube arrangement on the left and the target on the right. Note which colors need to change, be removed, or be added.
- 2Browse the function palette below the puzzle. Each block shows its name and a visual icon describing what it does.
- 3Drag or click functions into the pipeline slots. The live preview updates with every change so you can see the effect immediately.
- 4Pay close attention to function order — the pipeline applies left to right, and the same functions in a different sequence produce different results.
- 5Keep adjusting the pipeline until the preview matches the target exactly. When it does, the puzzle is solved and you advance to the next level.
Tips & Tricks
- Read function names carefully — they describe exactly what they do. A color-replacement function swaps every instance of one color for another. A filter function removes all cubes of a specified color from every column. No guessing required.
- When stuck, work backwards from the target. Ask: what is the last operation that must have produced this exact final state? Then figure out what the second-to-last step must have been, and continue back to the start.
- Order matters. If you need to replace a color and then remove it, try both sequences — one will produce the wrong intermediate result. Testing the reverse order of two functions is often faster than reasoning it out from scratch.
- Build the pipeline incrementally on harder puzzles. Get the first two functions right before adding a third. Debugging a two-step pipeline is far faster than trying to locate an unknown error in a five-step chain.
- If a puzzle's target contains a color that doesn't appear in any available function's name directly, that color must be produced as an intermediate result by some other transformation — think about which function might create it from the starting colors as a side effect.
Game Info
FAQ
No. All transformations are visual — you work with colored blocks, not code. If you do know functional programming, you will immediately recognize concepts like map, filter, and function composition.
The game has six chapters with multiple levels each, ranging from Easy to Hard difficulty. Chapter 0 introduces the basics; Chapter 5 reaches the hardest puzzles.
Because each function transforms the output of the previous one. 'Filter Red, then Map Blue → Red' removes reds first, then recolors blues — the reverse order gives completely different results. This is exactly how function composition works in real programming languages.
No. Cube Composer is entirely self-paced. Take as long as you need on each puzzle.
Yes — the game is open-source on GitHub. You can submit new puzzle chapters via pull request to the sharkdp/cube-composer repository.