Colossal Cave Adventure in the Browser — FORTRAN IV to WebAssembly with LFortran

I thought I’d try another classic Fortran game: Colossal Cave Adventure (1976), originally written in FORTRAN IV. After compiling it with LFortran and using Emscripten for the WebAssembly build, it’s now playable in the browser (and it’s quite tricky).

Unlike The Oregon Trail, which required very few changes to the original source, Colossal Cave Adventure needed quite a few modifications to get it working. I recorded those changes here.

5 Likes

Beautiful! I want to get LFortran eventually to be able to compile these old codes ideally without modifications. I think a lot of the old features would not be a big deal to support, likely hidden behind some compiler option. And until then doing the modifications is doable, as you have shown.