A Flask-based web application for playing the 'Guess 2/3 of the Average' game, a classic example of game theory. Players submit their guesses, and the app calculates the winner based on the closest guess to two-thirds of the average.
- Users can submit their guesses (between 1 and 100).
- Results are stored in an SQLite database.
- Developers can view the final results by entering a password.
- Visualized guess distribution using matplotlib.
This website was created as part of a presentation on Game Theory. The goal was to increase interaction with students during the presentation and make the session more engaging. To encourage participation, I added a prize for the winner, motivating everyone to join the game and guess 2/3 of the average.
The project is built using Flask for the backend, SQLite for storing guesses, and matplotlib for visualizing the results. It’s a fun and interactive way to explore game theory concepts!
-
Clone the repository:
git clone https://github.com/your-username/guess_game.git
-
Navigate to the project directory:
cd guess_game
-
Install the required packages:
pip install -r requirements.txt
-
Run the Flask application:
python flask_app.py
-
Open your browser and go to
http://127.0.0.1:5000
.
- Create a
.env
file in the root directory of the project. - Add the following variables to the
.env
file:SECRET_KEY=your_secret_key_here DATABASE_PATH=/path/to/your/database.db DEVELOPER_PASSWORD=your_developer_password_here
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push your changes to your fork.
- Submit a pull request.
This project is licensed under the MIT License.