sandfall
Join one colour from wall to wall to clear it. Chains send sand to your opponent. Last one standing wins.
play online
sandfall
sandfall is a falling-block puzzle game in the tradition of tetris, which alexey pajitnov created in 1984 at the computing centre of the soviet academy of sciences in moscow. in tetris, shapes made of four squares fall into a well, and filling a complete row clears it. sandfall keeps the falling shapes but turns them to sand: the moment a piece lands it crumbles into grains that pour and settle, and instead of filling a row you clear sand by joining one colour from the left wall to the right wall. play the bot, a friend through a shared link, or whoever is waiting in the queue, where chains send sand to your opponent and the last one standing wins.
how it works
the board is a grid of 80 × 160 grains (10 × 20 blocks, each 8 × 8 grains), stored as one byte per grain. the game runs at sixty ticks a second, and on each sand step every grain that can fall moves down one cell, or slides diagonally when the space below is taken, which is what makes the sand settle at a 45° slope. a few grains hesitate at random each step, so pieces break up and pour rather than dropping as solid blocks. after the sand moves, a flood fill looks for any single-colour region that touches both walls and removes it; sand that falls into the gap and completes another span counts as a chain.
every random choice comes from a seeded random number generator, so the same seed and the same key presses always produce exactly the same game. that one property does a lot of work: online, each browser sends only its key presses and the other re-plays them to draw your board, so there is no game server; high scores are checked by the server replaying your whole game from its seed and inputs; and the bot plans its moves by simulating where the sand would end up for every possible placement.