I ported Emacs’s tetris.el to the Lisp Badge. The result is quite playable! To give people an idea of what it looks like, here’s a screenshot of a McCLIM-based Lisp Badge simulator that I included alongside the uLisp code:
To try Tetrulisp on your own Lisp Badge, start by cloning this repository:
git clone --branch=game-on https://git.sr.ht/~fitzsim/lisp-badge
Build and flash the custom LispBadge.ino, then follow the instructions in tetrulisp.lisp for how to load the uLisp code. The instructions for the simulator are there too.
I had to make some changes to LispBadge.ino to implement keyboard scanning and a simple game grid. It may be possible to reimplement those customizations with defcode, so as not to require a custom uLisp.
Here is the help documentation:
Type (tetris) then press Enter to play. S: left, D: right, F: rot ccw, G: rot cw H: drop, J: sound, K: quit
It would be fun to hear if anyone else gets this working on their Lisp Badge.
Happy New Year,