Project 1B — A Multi-Room Adventure Loop (Your Language)

Extend your game so the player moves between rooms. A loop keeps the game running until the player wins or quits. Build it in your approved language, with your own room names and story.

Goals: what this project shows, in any language

By the end of 1B, your code should show that you can:

  1. Move through at least three rooms, with the player's current room stored in a variable.
  2. Describe a room with a function that takes a parameter. The same function should print a different description for each room it's given.
  3. Handle the player's choices in a function that takes the input and returns or changes the state of the game (for example, the next room).
  4. Use a loop with a clear ending condition, such as a won flag or a quit command. The loop must stop when the condition is met.
  5. Keep a list or other collection if your rooms or exits need one, and loop over it at least once.

What to Hand In

  • The loop runs, with the rooms and the ending working. Test both an ending win and a quit.
  • Concept-log rows for loops, functions with parameters, and the ending condition (at least 5 rows in total by CP2)
  • A commit with the prefix CP2:, pushed before your one-on-one

Every shared rule is on the Common Parameters card.

Getting Started

Get one room working before you add the loop. Then add the loop, then a second and third room. Run the game after each step.

Check your loop by running the game twice with different choices. If one of the runs gets stuck, you've found a loop with no way out.

What's Next

Coming up: Project 1C — inventory, and finding a planted bug.