Building a Text Adventure Using Rust
summary
Shows building a command-line text adventure in Rust, modeling rooms as a HashMap<i32, Room> with Room { title, description, transitions: Vec<i32> } and a Player holding a reference to the House; implements change_room returning Result to signal invalid moves and uses Vec::position to find transitions. Demonstrates Rust lifetimes (distinct 'a and 'b) and exposes the game as a REST service; workshop code is available on GitHub.
AI-written summary · about
chapters (11)
- 0:00Text adventure in Rust
- 3:54Rust project structure
- 8:11House data with lifetimes
- 11:46Room type and transitions
- 17:53House layout
- 22:04Player and House
- 26:55Player methods
- 33:30change_room method
- 43:08Modules to app
- 47:33Room transitions and errors
- 52:52Q&A
related talks
23mThe Rubyist's Illustrated Rust Adventure Survival Guide
16mThe Illustrated Adventure Survival Guide for New Rustaceans
19mThe Illustrated Adventure Survival Guide for New Rustaceans
23mMy First Rust Project: Creating a Roguelike with Amethyst
29mLearning Rust by accident
52mLearning Rust the wrong way.
40mWriting a simple game in Rust
01h 42mIntroduction to Rust (for people who have never used a compiler)
