A web-based implementation of the classic Boggle word game using Flask, featuring a 5x5 grid of randomly generated letters.
This application implements a digital version of Boggle, presenting players with a 5x5 grid of letters. The letters are generated using authentic Boggle dice configurations, ensuring game authenticity. Players can shuffle the board to start a new game configuration.
- Clone the repository
- Install the required dependencies:
pip install flask numpy
- Run the application:
python main.py
- Access the game at
http://localhost:5000
boggle/
├── main.py # Flask application entry point
├── model.py # Game logic and dice configuration
├── templates/
│ ├── index.html # Game board template
│ └── template.html # Base template
└── static/
└── styles.css # Game styling
The Flask application entry point that handles routing and game initialization.
@app.route("/")
def home():
# Generates and shuffles letters for the 5x5 grid
# Returns rendered template with 25 letter positions
Key Features:
- Initializes Flask application
- Handles route for main game page
- Manages letter distribution to the game board
- Contains commented timer functionality (currently disabled)
Contains the core game logic and dice configurations.
Functions:
-
getRandomLetters()
:- Generates a list of 25 random letters based on authentic Boggle dice configurations
- Returns a list of randomly selected letters from each die
-
shuffleDice(letters: list)
:- Takes a list of letters and randomly shuffles their positions
- Returns the shuffled list
The dice
list contains 25 authentic Boggle dice configurations, each with 6 possible letters.
The game board template, featuring:
- 5x5 grid layout using HTML table
- Letter placement using Flask template variables
- Shuffle button for new game configurations
- Commented-out timer functionality
Base template providing:
- HTML structure
- CSS styling links
- Responsive viewport configuration
- Central alignment for game elements
Styling definitions including:
- Custom font family
- Table and cell styling for the game board
- Responsive layout adjustments
- Board cell dimensions and borders
- Access the game through your web browser
- View the 5x5 grid of randomly generated letters
- Click "Shuffle Letters" to generate a new board configuration
- Use pen and paper to record found words
- Traditional Boggle rules apply:
- Words must be formed from adjacent letters
- Letters must be connected horizontally, vertically, or diagonally
- Each letter cube can only be used once per word
- Words must be at least 3 letters long
- Python 3.x
- Flask
- NumPy
- Modern web browser with JavaScript enabled
- Enable timer functionality
- Add word validation
- Implement score tracking
- Add multiplayer support
- Include dictionary verification