A text adventure

The problem

Build a small game in which the player moves between rooms, picks up items and has to solve a simple goal, all through typed commands.

Requirements

Technologies

Step by step

  1. Draw a map of four or five rooms on paper.
  2. Write the rooms as a dictionary, from room name to its details.
  3. Write a Player class with methods for moving and taking items.
  4. Write a function that splits a typed line into a verb and a noun.
  5. Use a dictionary from verbs to functions to handle each command.
  6. Add the winning condition, and check it after each command.
  7. Test every exit, and try impossible commands on purpose.

Expected result

A complete small game that a friend can play, in which the world is described by data rather than by code.

How it is evaluated

Ways to improve it