Games are an interesting stress test for the 1-bit constraint. A simulation can skip frames and still look fine. A game can’t. Input latency matters, collision detection matters, and the player is paying close attention in a way that they aren’t when watching a visual effect. If the game loop is wrong, you notice immediately.
Both of these work. Unironically.
Pong (interactive) Link to heading
Two players. Left paddle: W and S. Right paddle: up and down arrow keys.
The ball is a single checkbox. The paddles are vertical strips a few cells tall. Collision detection uses floating-point bounding-box checks against the paddle positions, not checkbox state. Using checkbox state would mean rounding the ball’s true position to a cell boundary before testing contact, which introduces a full cell of fuzziness. At this grid resolution that’s enough to let the ball ghost through the edge of a paddle. Keep the physics separate from the display.
The ball speeds up with each rally. It scores.
Each frame clears the entire grid and redraws everything. At this resolution that’s fast enough to not matter.
Snake (interactive) Link to heading
Arrow keys or WASD. Classic Snake rules: eat the food, grow the tail, don’t hit yourself or the walls.
The tail is represented as a queue of occupied cells. Each frame, a new head cell is checked and, if the snake didn’t eat, the oldest tail cell is unchecked. O(1) for both operations. The food spawns at a random unchecked cell. Self-collision is a linear scan of the tail array, which is O(n) in tail length but the grid is small enough that it doesn’t register.
The grid wraps at all edges.
Part of the Checkbox Canvas series. See also: Simulations, Visual Effects, Images & Video.