{"id":28576914,"url":"https://github.com/valeqm/escape-room-trivia","last_synced_at":"2025-08-22T13:45:54.260Z","repository":{"id":290583081,"uuid":"974937419","full_name":"valeqm/Escape-Room-Trivia","owner":"valeqm","description":"An interactive trivia escape room challenge where users answer questions to unlock the next stage. This project was developed as part of Harvard's CS50P course.","archived":false,"fork":false,"pushed_at":"2025-04-29T14:38:39.000Z","size":535,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T15:47:46.527Z","etag":null,"topics":["cs50","cs50p","escape-room-game","python","python-games","python-library","trivia-game","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valeqm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T14:28:13.000Z","updated_at":"2025-04-29T14:45:45.000Z","dependencies_parsed_at":"2025-04-29T15:49:10.338Z","dependency_job_id":"b742c3d4-ea25-4169-9f4b-c516b72a3ee9","html_url":"https://github.com/valeqm/Escape-Room-Trivia","commit_stats":null,"previous_names":["valeqm/escape-room-trivia"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeqm%2FEscape-Room-Trivia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeqm%2FEscape-Room-Trivia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeqm%2FEscape-Room-Trivia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeqm%2FEscape-Room-Trivia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valeqm","download_url":"https://codeload.github.com/valeqm/Escape-Room-Trivia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeqm%2FEscape-Room-Trivia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172987,"owners_count":22816560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cs50","cs50p","escape-room-game","python","python-games","python-library","trivia-game","unit-testing"],"created_at":"2025-06-11T00:07:52.736Z","updated_at":"2025-06-11T00:07:53.832Z","avatar_url":"https://github.com/valeqm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Escape Room Trivia\n\nThis code is for the final project of [CS50 Python](https://cs50.harvard.edu/python/2022/).\n\n## Description\n**Escape Room Trivia** is an interactive terminal-based game where you select the difficulty and category of the games you want to play.  \nYou must complete **4 different games** to \"escape the room\":\n\n- **Rock Paper Scissors**  \n- **Hangman**  \n- **Number Guessing**  \n- **Trivia**\n\nEach game gives you part of a code needed to escape. Win all challenges to complete the escape!\n\n\n## Project Structure\n```\nproject/\n│\n├── project.py\n├── test_project.py\n├── certificate.png\n├── README.md\n└── requirements.txt\n```\n\n\n## Libraries Used\n- **requests**: To make API calls to fetch trivia questions.\n- **html**: To decode HTML entities from API responses.\n- **random**: To shuffle options and generate random numbers or choices.\n- **time**: To manage delays in the game for better user experience.\n- **os**: To clear the terminal screen.\n- **fpdf**: To generate a personalized certificate upon winning.\n- **Pillow (PIL)**: To manipulate images for the certificate.\n- **pytest**: To write and run test cases for different parts of the code.\n\n\n## How It Works\n\n### Utility Functions\n- **clear()**  \n  Clears the terminal screen depending on the operating system.\n\n- **print_ascii_header()**  \n  Displays the game title in ASCII art style.\n\n- **get_user_choice(prompt, options)**  \n  Displays a list of choices based on a prompt and validates user input.\n\n- **start_game()**  \n  Displays the welcome message, difficulty options, and category options. Returns the selected level and category for the game.\n\n\n### Games\n\n#### 1. Trivia Game (3 functions)\n- **get_question(level, category)**  \n  Fetches a trivia question from the [Open Trivia Database](https://opentdb.com/api_config.php) API.\n\n- **play_question(question_data)**  \n  Displays a trivia question and checks if the user's answer is correct.\n\n- **trivia_game(level, category)**  \n  Manages the trivia game logic, tracks lives (you have 3 lives), and returns a part of the escape code if successful.\n\n\n#### 2. Rock Paper Scissors\n- **rock_paper_scissors(level)**  \n  You need to win a set number of rounds (depending on difficulty) against the computer to pass.\n\n\n#### 3. Number Guessing Game\n- **number_guessing_game(level)**  \n  Try to guess a randomly chosen number between 1 and 100 within a limited number of tries depending on the difficulty.\n\n\n#### 4. Hangman Game\n- **hangman_game(level)**  \n  Classic hangman game with words depending on difficulty. You have 15 chances to guess the word correctly.\n\n\n### Certificate\n- **generate_certificate(name)**  \n  After successfully completing all games on hard mode, you can generate a **PDF certificate** with your name to celebrate your escape!\n\n\n### Main Function\n- **main()**  \n  Starts the whole game and organizes the flow from one game to another until you escape or fail.\n\n\n## Display Example\nWhen you start the game, the terminal would look like this:\n\n```\n=======================================\n         ESCAPE ROOM TRIVIA\n=======================================\n\nSelect Difficulty:\n1. easy\n2. medium\n3. hard\n\nChoose an option: \n```\n\n\n## How to Install\n\n1. Download the folder:\n   ```bash\n   git clone https://github.com/valeqm/Escape-Room-Trivia.git\n   ```\n\n2. Navigate into the project folder:\n   ```bash\n   cd Escape-Room-Trivia\n   ```\n\n3. Install the required libraries:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Run the game:\n   ```bash\n   python project.py\n   ```\n\n\n## Author  \n\n**Valeria Q.M** \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleqm%2Fescape-room-trivia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaleqm%2Fescape-room-trivia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleqm%2Fescape-room-trivia/lists"}