Assignment Overview
Build a Text Adventure Game where players explore rooms, collect items, solve puzzles, and manage inventory using arrays, strings, and vectors.
Arrays (4.1)
Game map, room data, player stats
Strings (4.2)
Descriptions, commands, parsing
Vectors (4.3)
Dynamic inventory, item collection
The Scenario
The Mysterious Mansion
Create "The Mysterious Mansion" - a text adventure where players explore a haunted mansion, collect keys and items, solve puzzles, and try to escape.
Requirements
Game Map (2D Array)
Create a 5x5 grid representing mansion rooms. Each cell contains room type (0-5 for different rooms).
Room Descriptions (String Array)
Store descriptions for each room type. Use string manipulation for dynamic messages.
Inventory System (Vector)
Use vector<string> for player inventory. Implement add, remove, display, search operations.
Command Parser
Parse commands like "go north", "take key", "use lantern", "inventory", "look".
Game State
Track player position, health, visited rooms (bool array), and win/lose conditions.
Submission
Required Repository Name
cpp-text-adventure
cpp-text-adventure/
├── game.cpp # Main game file
├── game.h # Header with declarations
├── sample_output.txt # Sample gameplay
└── README.md # How to play guide
Grading Rubric
| Criteria | Points |
|---|---|
| Game Map (2D array) | 30 |
| Room System (string arrays) | 30 |
| Inventory (vector operations) | 40 |
| Command Parser (string manipulation) | 35 |
| Game Logic & Win Condition | 35 |
| Code Quality | 30 |
| Total | 200 |