Learn to Code ยท zero-dependency ยท MIT

larzgame

A tiny text-adventure engine.

Building a text adventure is a fun, motivating first project. Define rooms, connect them, place items and set a goal; the engine handles the parser, movement, inventory and win condition. Every command is testable, with a play() loop when you want to actually play.

larzscript pkg install game
View on GitHub →Learn the stack

What you get

Try it

import "game" as game
let w = game.world()
game.room(w, "hall", "A dim hall.", {"north": "study"})
game.room(w, "study", "A quiet study.", {"south": "hall"})
game.item(w, "key", "study")
game.win_on_item(w, "key")
let g = game.new_game(w, "hall")
print(game.command(g, "go north"))
print(game.command(g, "take key"))
print(game.won(g))
Output
A quiet study. You see: key. Exits: south.
You take the key.
true

Why it's in the Larz Stack

larzgame is a real Larzscript package (larzscript pkg install game) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.