← All Workshops
MudEngine Part 2: Single-Player REPL
Step 9 / 10
Play!
Run the REPL and explore the tiny world we built. Type look to see where you
are, north or east to move, and help to see all commands.
Run the REPL
cargo runPlay session (expected output)
> look
Town Square
A bustling town square with a fountain at its center. Cobblestones gleam from the morning rain.
Exits: north east
> north
Market Street
A narrow lane lined with wooden stalls. The scent of fresh bread and spices hangs in the air.
Exits: south
> south
Town Square
A bustling town square with a fountain at its center. Cobblestones gleam from the morning rain.
Exits: north east
> east
Temple Courtyard
Ancient stone pillars surround a quiet courtyard. Moss clings to weathered statues.
Exits: west
> quit
Farewell, adventurer!
🎯 Extend the world
Once the REPL is running, try adding your own rooms. Edit the rooms vector
in World::new():
Room {
id: 4,
name: "Dark Forest".into(),
description: "Twisted trees block out the sky. Eyes gleam in the shadows.".into(),
exits: vec![("south".into(), 2)], // connects back to Market Street
},
Don't forget to add a matching exit in the room you want to connect from!
Step 9 / 10