C4 Jester
This is the well known connect-four game, written in a Janet-derived dialect of Lisp and transpiled to play in the browser!
Space bar to start game at title screen. Then left/right to move the cursor and down arrow to drop the chip. Red and Black take turns until one player manages to get four in a row or the entire board is filled. At the end, you will have the option to restart or return to the title screen.
This was originally a demo game for my Canned Heat game engine, which I wrote in Urlang in Racket. Urlang transpiles to JavaScript and has macros and extensive error checking. However, I've been doing a lot of stuff in Janet recently and it has really good Parsing Expression Grammar support. So I wondered how hard it might be to do something similar with just text transformations? The answer is: it's not easy but certainly doable! I wrote a simple transpiler (less than 200 LOC), which I called "Jester". To test it, I reimplemented my demo game.
The game got a bit shorter and simpler for some reason, but everything works the same as the original -- it even uses the same assets. So, while Jester is probably not yet ready for any serious production work, it seems quite usable for small projects!

Leave a comment
Log in with itch.io to leave a comment.