SlamProject is a small Python project implementing a "Slam" (quiz / word-grid) game. It contains both a Flask-based web front-end (templates + static assets) and a set of Python modules that implement the game logic (grid generation, questions, players and turn handling). The project was developed as a student project for a course.
- A web interface served by
EssaiSite.pyusing Flask and templates intemplates/. - A core game engine in
game.pythat manages turns, the final grid and interactions between players and the grid. - Grid generation / crossword-like placement logic in
grid.py(uses NumPy). - Support files for words/questions:
mots.txt,questions.txt, andfinal.txt(final grid data).
Requirements:
- Python 3.8+ (tested with CPython)
- pip
- The project uses the following Python packages:
- Flask
- numpy
Install dependencies:
pip install Flask numpyRun the web interface (development server):
python EssaiSite.py
# then open http://127.0.0.1:5000 in your browserRun the game in CLI (basic):
python game.pyThe CLI is a simple interactive runner used for testing the game logic and final-turn flow.
EssaiSite.py: Flask web server that exposes routes and renders templates.game.py: Core game logic — Game class, initialization of questions/words, and examplejeuinstance.grid.py: Grid generation, placement and helper methods (uses NumPy).player.py: Player classes (Player, HumanPlayer, BotPlayer).question.py: Question data class.mots.txt: Words used to populate the grids (format expected: word - definition).questions.txt: Questions list (format: question title - answer).final.txt: Final grid data (format expected bygame.init_final_grid).templates/: Jinja2 HTML templates used by the web UI (SiteSlam.html,SiteSlam2.html, ...).static/: Static assets (JS and CSS used by the web pages).ReadMe: This file (project README).
questions.txtlines: each line should be "<title> - ".game.init_questionssplits on " - ".mots.txtlines: each line should be " - " (used byinit_words). Duplicate words are filtered.final.txtis parsed byinit_final_grid. The code expects a specific structure — inspectgame.init_final_gridfor details.- The grid generator is stochastic and may fail to generate a full grid on some runs; the code retries and returns False on failure.