PolyFit

the only fit that never overfits.

The 3-minute challenge

Three minutes. One score.

Modern rules: T-spins, back-to-back, combos. Score as much as you can before the clock runs out.

← → move · ↑ rotate · Space drop

Drag to move · tap to rotate · flick down to drop

Leaderboards

Hall of Fame

They beat my record and sent me their game. Each game is replayed in your browser, move by move: no score here can be made up.

Top 10 on this device

Like an arcade cabinet: your best games, with the name you type at the end. They stay in this browser.

Your games will appear here, best first.

Challenge a friend

At the end of a game, “Challenge a friend” makes a link with your whole game inside: your name, the pieces and every move, in about 1,500 characters.

Whoever opens it plays the same pieces, with your game replayed next to theirs. No account, no server: the link is the game, and their browser checks the score by playing it again.

Controls

← →
Move
↓
Soft drop
Space
Hard drop
↑ X
Rotate right
Z
Rotate left
C Shift
Hold
Esc P
Pause
M
Sound on / off
N
Music on / off
Drag left or right
Move
Tap
Rotate right
Drag down slowly
Soft drop
Flick down
Hard drop
Flick up
Hold

A small sign inside every piece tells them apart without relying on color.

The moves, explained

PolyFit!
Four lines at once, the biggest plain clear. Only the long I piece can do it: keep one column free for it.
T-spin
Turn a T into a tight slot as its very last move, with at least three of the four corners around its center blocked. A T-spin Double scores half as much again as a PolyFit!.
T-spin Mini
A smaller T-spin, when the corners on the side the T points to are not both blocked. Fewer points, same back-to-back bonus.
Back-to-back
PolyFit!s and T-spins that clear lines, one after the other with no plain clear in between: from the second one on, each scores ×1.5.
Combo
Clear lines with several pieces in a row: every piece after the first adds 50 × combo × level. A piece that clears nothing ends it.
Perfect clear
Leave the board completely empty: a bonus on top of the lines, up to 3,200 × level for a back-to-back PolyFit!.

How it's built

The rules, apart from the screen

The engine runs in fixed steps of 1/60 of a second, with whole-number gravity and a seeded random generator. The same seed and the same inputs replay the same game, to the last point: that is how a challenge link proves its score, in the browser of whoever opens it.

62 automated tests

Every scoring rule, the rotation kicks, the lock delay, the clock and the challenge links. An automatic player plays full games while every rule is checked at every step, and each game is replayed to prove it comes out identical.

For every player

Keyboard and touch controls, light and dark themes, a mark inside every piece for color-blind players, and less motion for those who ask their system for it.

Made from scratch

No frameworks, no libraries, no audio files: plain JavaScript, drawing on canvas, and sounds and music made on the spot with the Web Audio API, on four 8-bit voices. The music is Korobeiniki, a Russian folk song of 1861, in a new arrangement. The colors and fonts are the site's own.

Read the full case study → · Read the 19-page report ↗