A minimal terminal Tetris written in Zig. Tested with Zig 0.15.2
zig build run
Cursor keys to move, space to drop, q to quit.
./run-as-service.sh
ssh zigtris@localhost -p 2022
Some notes for anyone looking at the code:
Displayis a thin wrapper on top of themibuterminal library, it provides a double buffered one pixel per character interface where it only redraws changed pixels on the buffer flipStageis the game stage and provides a square pixel interface on top ofDisplay(by printing two chars for each pixel)Playerholds theTetronimoshapes and movement logicDebrisholds the list of fallen blocks for hitchecking and completed line detection
MIT
