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.

Share:PostRedditShare

You might also like

Frequently Asked Questions about Cube Composer

How do I play Cube Composer?
Each level shows a stack of colored cubes and a goal pattern. You build a program by clicking or dragging transformation functions (like 'map yellow to red' or 'stack') into your program list. The functions run left to right on the cubes, and you win when the result matches the goal.
Is Cube Composer free to play online?
Yes! Cube Composer on PlayBrain is completely free to play in your browser. No downloads, no sign-ups, and no ads blocking gameplay.
What is Cube Composer about?
Cube Composer is a puzzle game inspired by functional programming. You compose a sequence of small functions that each transform the cubes in a specific way, then chain them together to reach the target arrangement. It teaches the core idea of function composition without any coding.
Do I need to know programming to play?
No. Cube Composer uses visual function blocks, so you never type any code. It does gently introduce ideas from functional programming like mapping and composition, which makes it a fun, low-pressure way to think like a programmer.
How do I reset or skip a level?
Press the R key (or click Reset) to clear your current program and try again, and press N (or click Next level) once you have solved a level to move on. You can also pick any level from the dropdown at the top.
Is Cube Composer open source?
Yes. Cube Composer was created by David Peter (sharkdp) and is released under the MIT License. PlayBrain self-hosts the original open-source build.

About Cube Composer

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.

How to Play

  1. Look at the goal pattern at the top to see the arrangement of cubes you need to create.
  2. Click or drag transformation functions from the left into your program on the right.
  3. Order the functions so that, run left to right, they transform the cubes into the goal.
  4. When the result matches the goal the level is solved. Press N for the next level, or R to reset.

Credits: Cube Composer by David Peter (sharkdp), released under the MIT License. Source: github.com/sharkdp/cube-composer