Skip to content

A Flask-based web application for playing the "Guess 2/3 of the Average" game.

License

Notifications You must be signed in to change notification settings

LuChristCho/TwoThirdsChallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

    git clone https://github.com/your-username/guess_game.git
  2. Navigate to the project directory:

    cd guess_game
  3. Install the required packages:

    pip install -r requirements.txt
  4. Run the Flask application:

    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:
    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.

About

A Flask-based web application for playing the "Guess 2/3 of the Average" game.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published