Every function running in that game is one you wrote yourself: the board, the rotation maths, the referee, the line clearing, the scoring, the speed curve and the keyboard.
Now go and play the finished game — ▩ Tetris — or open funtime/lib/ and read the 40 other functions that turn your twelve into a whole game.
Next challenge: add a "hold piece" box, a high-score list, or make the board 15 columns wide.
🎮 The game so far
…
📋 How this works
Each step asks for one function from the real game. The INPUT / OUTPUT / ALGORITHM comment at the top of the editor tells you everything you need — and there is a copy above it you can open any time.
Press ▶ Test it to run real checks on your function. Every ❌ tells you what it expected and what it got.
When all the tests pass, the next step unlocks and the demo switches to your code.
Use 🎬 The goal any time to see what the demo should look like when it works.
Your code is saved in this browser, so you can close the page and come back later.
⚠️ A while loop that never stops is caught after 2 seconds and reported as a mistake — so you can fix it instead of reloading.