This is an interactive Python game where players guess the names of U.S. states. The game uses Turtle graphics to display a map of the U.S., and the player’s task is to correctly identify all 50 states by typing their names. If the player decides to exit the game, the unguessed states are saved to a CSV file for later reference.
- The program displays a blank map of the U.S. using Turtle graphics.
- Players are prompted to type the name of a state.
- Correct guesses are displayed on the map at the corresponding state’s location.
- If the player types "Exit," the game ends, and the states they missed are saved to a file named
missing_states.csv
.
- Interactive map using Turtle graphics.
- Dynamic prompts to track the player’s progress.
- Saves missed states to a CSV file for further learning.
- Random color generation functionality (not directly used in this version).
- Python 3.6 or higher
- Required libraries:
turtle
pandas
random
- Clone this repository or download the source code.
- Ensure you have Python installed on your system.
- Install the required libraries:
pip install pandas
- Place the
50_states.csv
file and theblank_states_img.gif
map image in the same directory as the Python script.
- Run the script:
python us_states_game.py
- A map of the U.S. will appear.
- Enter the name of a state in the prompt. If correct, the state name will appear on the map.
- To end the game early, type "Exit." A file named
missing_states.csv
will be created, listing the states you didn’t guess.
main.py
: Main script.50_states.csv
: Contains the names and coordinates of all 50 states.blank_states_img.gif
: Background map image.missing_states.csv
: Generated during gameplay, containing unguessed states.
- After guessing correctly:
- The guessed state name appears on the map at its correct location.
- Upon exiting:
- A file
missing_states.csv
is created with the following format:Texas California Florida ...
- A file