This is Practical Python Milestone Project called Riddle Me This.
The game is a series of 10 text based riddles which are presented to the user one at a time
The player must choose a username at the beginning of the game which will be unique.
The player is presented with a series of 10 text based riddles. Players enter their answer into a text box form.
If the player guesses correctly, they are directed to the next riddle and awarded 1 point. If a player guesses incorrectly, their incorrect guess is storedand printed below the riddle.
At the end of the game, the players score will be recorded on the leaderboard using their username as a reference.
Some of the tech used includes:
- HTML and CSS
- To structure and style the web app content, Including creating the POST method form
- To design the logic of the game
- For reading from, and writing to, the game’s text files
- For unit testing the game’s functions. These tests are found in test_game.py
- Creating a requirements.txt and Procfile to deploy the app on Heroku
- Sorting the leadboard data
- For binding functions to URLs using routing
- To render HTML templates, including the use of a base template. These templates are in the templates directory
- To enable Python programming within HTML pages
- To trigger functions on GET or POST requests
- For getting data from, and dumping data to, JSON files
- Used for debugging
- For storing and editing player data (players.json) and previously asked questions (used_questions.json) throughout the game
- Used to store high score data, found in /data/high_scores.json
- Used primarily for the website’s grid layout and for styling buttons, player cards, and the leaderboard table