Introduction to Python - Final Project 1. - Quiz Game
Summary of the Project:
The project is a Python implementation of the quiz game. The game is designed to simulate the experience of playing the game, with features such as:
- A quiz game with 15 questions, each with a different point value. The code should generate 3 sets of 5 random questions and answers. These 3 sets are three difficulty levels (easy, moderate, and hard). The questions should gradualy progress from the easiest to the hardest.
- A scoring system that keeps track of the player’s points and displays them at the end of the game.
- A high score system that saves the player’s score and displays it in a leaderboard.
- A menu system that allows the player to choose between playing the game, viewing their high scores, viewing instructions on how to play, or quitting the game.
Guidelines for Students:
To complete this project, students will need to follow these guidelines:
- Quiz Game: The quiz game should be implemented using a class-based approach. The class should have methods for generating questions, checking answers, and keeping track of the player’s score. The game ends when the user enters a wrong answer or when all the questions are answered.
- Scoring System: The scoring system should be implemented using a dictionary that maps question numbers to point values. The system should also keep track of the player’s total score and display it at the end of the game.
- High Score System: The high score system should be implemented using a
csv
orjson
file. The system should save the player’s score and display it in a leaderboard. - Menu System: The menu system should be implemented using a simple text-based menu that allows the player to choose between playing the game, viewing their high scores, viewing instructions on how to play, or quitting the game.
- API/Web Scraping: Students are encouraged to use APIs or web scraping techniques to fetch data from external sources. For example, they could use the Trivia API to fetch questions and answers.
- Error Handling: Students should implement error handling mechanisms to handle invalid user input, incorrect answers, and other potential errors that may arise during gameplay.
Suggestions for Using APIs or Web Scraping:
- Trivia API: Use the Trivia API to fetch questions and answers for different categories and difficulty levels.
Additional Tips:
- Use Commenting: Use comments to explain your code and make it easier for others to understand.
- Test Your Code: Test your code thoroughly to ensure that it works correctly and handles errors properly.
- Follow PEP8 Guidelines: Follow PEP8 guidelines for coding style and formatting.
- Use Version Control (optional): Use version control tools such as Git to track changes to your code and collaborate with others.
- External Files For Screen Outputs: Use external files for screen outputs such as a summary of the game, win/lose screen, instructions how to play, menu screen. Avoid using multiple line strings when possible.
- Implement Key Press detection and screen cleaning: Use key press detection and screen cleaning to make the game more responsive and user-friendly. There are differences between Windows and Unix systems, so you would have to detect which system is being used in order to have these options working.
- Make necessary setup files: Make necessary setup files for your projects:
.gitignore
requirements.txt
README.md
.env
- Use Documentation: Write documentation for your code and explain how it works, which technologies you are using, and features of your code.
- GitHub Upload: Upload your project to GitHub.
- YouTube Video: Record and upload a YouTube video of your project where you explain your code and the execution of it.
Additional Resources:
Conclusion:
The project should be your showcase of Python knowledge and skills. It should be a fun and educational learning experience. And I will assist all of you to make it presentable and according to the industry standards.
This post is licensed under CC BY 4.0 by the author.