🟦 Tetris Brain

A greedy bot looks at every way it could drop the current piece and scores each landing with a weighted sum of four numbers about the resulting board — its bumpiness, its holes, its height, its line clears — then plays the best one. It can only play as well as those four weights let it. Tune them to clear the most lines. The catch: the pieces come in a random order, so every game is different and the score is noisy — weights that ace three games may flop on the next.

🧠 Human Raphson

Set the bot's four weights yourself and watch it play. Negative means "avoid this." Can you beat the optimiser?

Algorithm

Lines cleared
In-sample (train)
Out-of-sample
Weight-sets tried0
Best weights

Leaderboard (this session)

In-sample is the average lines on the seeds the optimiser trained on; out-of-sample is the average on eight fresh, unseen games. The gap between them is overfitting — weights tuned to a few lucky games don't always travel.

AlgorithmOut-of-sampleIn-sampleWeights H / L / Ho / B
— no runs yet —

What's happening

The bot itself is fixed and dumb: for the current piece it tries every rotation and column, simulates the drop, and rates the resulting board by w₁·height + w₂·lines + w₃·holes + w₄·bumpiness. It greedily plays the highest-rated landing. Everything rides on the four w's, and that 4-number vector is what the optimiser searches. A bad vector buries itself in holes and tops out in seconds; a good one keeps the stack low and flat and survives for hundreds of pieces.

Two things make this a real optimisation problem rather than a puzzle. First, it's noisy: piece order is random, so the same weights score differently each game — which is why you can choose to average several games per evaluation, trading speed for a steadier signal, and why the in-sample score flatters the weights relative to held-out games. Second, the bot does not rediscover the "textbook" weights (reward lines, punish holes); it often finds odd-looking vectors — sometimes even penalising line-clears — that nonetheless play well, because keeping the board survivable matters more than grabbing every line. More than one set of weights is good.

Only four dimensions here — which flips the verdict from our Genetic Art demo: there CMA-ES was too slow to even list (a 300×300 covariance matrix); here, in 4-D, that same machinery is cheap and CMA-ES is often the one to beat. The best optimiser depends on the problem.


A stylised 7-wide, 16-tall board with a one-piece-lookahead bot — narrower than a real Tetris well so that weight quality, not luck, decides how long the bot survives. The greedy heuristic and the noise are real.

🌱 Save the Planet

If your hyper-parameter searches are heating the Earth, drop this in Cursor or Claude:

Read https://raw.githubusercontent.com/microprediction/humpday/main/SKILL.md
and create a project skill from it.
View SKILL.md →