Puzzle · Logic

Cube Composer

Drag pure-function tiles such as map, filter, reverse, sort and color-mappers into a live pipeline that reshapes an isometric cube wall to match the target across six chapters.

Overview

Bolting pure functions into a pipeline until an isometric wall of colored cubes snaps into the target shape is the entire exercise. cube-composer, written in PureScript by David Peter — the developer behind the bat, fd, and hexyl command-line tools — and released under an MIT license, treats every puzzle as a problem in mathematical function composition. The left panel offers transformer tiles such as map, filter, reverse, sort, and color-mappers that convert every Yellow cube to Red, and you assemble a subset of them, in order, into the program column on the right. The pipeline runs live on an initial two-dimensional grid of cubes rendered isometrically on a canvas, depth-sorted so the wall reads as a solid object, and the goal is to choose and order functions so the resulting wall exactly matches each level's target. Six themed chapters — Easy, Medium, and Hard — each ship a distinct transformer set, teaching the primitives before demanding longer interleaved compositions. It appeals most to players who think in pipelines: programmers, spreadsheet builders, and fans of logic puzzles whose rules are functional and whose feedback is instantaneous.

How to Play

Build a program by dragging function tiles from the Available column on the left into the Program column on the right, or simply click a tile to toggle it in and out — both the drag-and-drop path and the click path produce the same effect, and the pipeline re-runs the moment the column changes. Press R to reset the program, N or the Right arrow to jump to the next level, and P or the Left arrow to step back; the arrow keys are ignored while Ctrl is held, so you can ctrl-click without losing your place. When the transformed wall exactly matches the target, a solved marker appears and you advance. Mouse input drives everything — the only on-screen buttons are Reset and Next-level — and touch input is not supported, because the interaction depends on drag-and-drop.

Tips & Strategy

Read the pipeline rightward from the first function, because each transformer feeds the next and order is as load-bearing as tile choice — reversing before a color-map yields a different wall than reversing after, and a sort dropped between two filters reorders cubes you still needed grouped. Before adding anything, count the target: if it holds the same cubes as the start, you need only reordering functions such as reverse and sort, and any filter or map will push the counts apart. Apply color-map tiles last, once the spatial arrangement is correct, because remapping colors on an unsorted wall hides the structure you are still building. When a chapter introduces a new transformer, solve its first level with that single tile to confirm exactly what it does, then chain — the live preview makes the probe essentially free. Progress persists to localStorage per level, so you can leave a hard chapter and resume without replaying the early ones.

Controls

Keyboard
R — reset the programN or Right arrow — next levelP or Left arrow — previous level
Mouse
Drag function tiles between the Available and Program columns, or click a tile to toggle it in or out; click Reset or Next-level to advance.

Features

  • Isometric 3D cube rendering with depth-sorted faces
  • Six themed chapters (Easy, Medium, Hard) each with a distinct transformer set
  • Live pipeline that re-runs whenever tiles are added, removed, or reordered
  • Transformers include map, filter, reverse, sort, and color-mappers (e.g. map Yellow to Red)
  • Per-level progress persisted to localStorage
  • Open source under the MIT license, written in PureScript by David Peter (sharkdp)