https://github.com/luchristcho/twothirdschallenge
A Flask-based web application for playing the "Guess 2/3 of the Average" game.
https://github.com/luchristcho/twothirdschallenge
gametheory html minigame python website
Last synced: 2 days ago
JSON representation
A Flask-based web application for playing the "Guess 2/3 of the Average" game.
- Host: GitHub
- URL: https://github.com/luchristcho/twothirdschallenge
- Owner: LuChristCho
- License: mit
- Created: 2025-03-08T18:46:43.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-12T06:35:32.000Z (6 months ago)
- Last Synced: 2025-04-28T12:53:44.721Z (6 months ago)
- Topics: gametheory, html, minigame, python, website
- Language: HTML
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Guess 2/3 of the Average Game
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.
## Features
- 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.## About the Project
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!
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/guess_game.git
```2. Navigate to the project directory:
```bash
cd guess_game
```3. Install the required packages:
```bash
pip install -r requirements.txt
```4. Run the Flask application:
```bash
python flask_app.py
```5. Open your browser and go to `http://127.0.0.1:5000`.
## Set Up Environment Variables
1. Create a `.env` file in the root directory of the project.
2. Add the following variables to the `.env` file:
```plaintext
SECRET_KEY=your_secret_key_here
DATABASE_PATH=/path/to/your/database.db
DEVELOPER_PASSWORD=your_developer_password_here
```## Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Commit your changes.
4. Push your changes to your fork.
5. Submit a pull request.## License
This project is licensed under the [MIT License](LICENSE).