Lists and Lists educational text adventure - uLisp port


#1

I was curious how well AI coding agents could write Lisp, and simultaneously wanted to learn some Lisp myself again.

Lists and Lists

As a toy project, I asked an agent to port the 1996 game Lists and Lists by Andrew Plotkin (https://ifdb.org/viewgame?id=zj3ie12ewi1mrj1t) to Common Lisp.
Lists and Lists is a Z-machine tutorial text “adventure” with the goal of teaching the player Scheme. A special feature of Lists and Lists is that it includes a nearly complete Scheme interpreter in-game.

The game’s source code is available as Inform source. The port that I had an AI agent make was a good starting point for me to explore some parts of Common Lisp that I hadn’t touched before - I made some modifications to use the Common Lisp Object System (CLOS), and did a few further iterations to get the port more in line with the functionality of the original.

uLisp port

I’m awaiting to receive a PicoCalc when my order ships, so I decided to also try doing a port to uLisp. The initial port was done by an AI agent as well (with access to the uLisp language reference), though a few iterations were needed to replace all the remaining Common Lisp features that uLisp doesn’t come with. I also had it port the CLOS object definitions to the uLisp Simple Object System + type-based dispatch functions.

You can find the result at https://github.com/danielmewes/lists_and_lists_cl/blob/main/ulisp/lists-and-lists.lisp
Just load the file, and evaluate (play-game) to start the game.

The uLisp version is functionally equivalent to the Common Lisp port, except for some limitations in the error handling within the in-game Scheme interpreter (you’ll only see a generic error message, rather than detailed error messages due to uLisp’s lack of handler-case). Both versions cover all main functionality of the original game, with only a few details being different.

Playing it

Thanks to @eliot 's great work on porting uLisp to WASM, you can try the game directly in your browser. Just go to https://eliot-akira.github.io/ulisp-wasm/ , copy&paste the code from Github, and add (play-game) to the end of it.


#2

Thanks for the post!

Sorry, I wasn’t aware of this limit - I’ve increased it, and edited your post to include the proper link.