Day 002 of the 100 Days of Python challenge turns Python conditionals into a small text adventure: The Pyramid Escape Room. The player must answer a riddle, choose a path, and select the safe door to find the treasure.

Project Overview

The game begins with a keyboard riddle. A correct answer opens a hidden chamber with two paths. Choosing the left path leads to three doors: red, yellow, and blue. Only the yellow door leads to the treasure; the other choices end the game.

The program uses input().lower() so the player’s answers can be compared consistently even when capitalization differs. Nested if, elif, and else blocks represent the branching story.

The Decision Tree

Riddle: keyboard?
  Yes -> choose left or right
    Left -> choose red, yellow, or blue
      Yellow -> treasure
      Red or blue -> game over
    Right -> game over
  No -> game over

Large strings of ASCII art provide the setting, treasure reward, failure scene, and beast encounter. They make the terminal experience more visual without requiring an external game engine.

What This Project Teaches

Day 002 demonstrates conditional statements, nested conditions, string methods, user input, and designing a simple decision tree. It also shows how program flow can model a story: each answer determines which block executes next.

A useful next improvement would be to move each scene into a function and validate the accepted choices more explicitly. That would make the story easier to expand without deeply nested code.

Running the Project

cd 100daysofpython/day002
python main.py

View the Day 002 source code on GitHub.