How asiyaibrahim478/connect_4_game works
This repository implements a Connect Four game with two user-facing options: a browser client backed by Flask APIs and a Streamlit application. In the browser flow, a player makes moves, Flask selects an AI move, and finished games are saved; recorded data can feed model retraining. Training combines available datasets, evaluates three classifiers, and selects an active model. README contains no capability details, and the Streamlit excerpt is partial, so its unshown runtime connections are omitted.
Main entry points: app.py Flask API · train_models.py Model training · main.py Streamlit launcher · script.js Browser game
Components 11
Game interfaces
- Browser game
script.js - Game page
index.html - Streamlit game
streamlit_app.py
Game backend
- Flask API
app.py - AI move search
app.py - Streamlit launcher
main.py
Model learning
- Model training
train_models.py - Saved classifiers
models
Game data
- Game history storage
connect_db.py - Training data loader
connect_db.py
Other components
- Player
Connections 14
- Player → Browser game: plays
script.js - Browser game → Game page: renders board
script.js - Browser game → Flask API: requests moves
script.js - Flask API → AI move search: dispatches search
app.py - Flask API → Game history storage: saves result
app.py - Player → Streamlit game: plays
- Flask API → Saved classifiers: loads classifier
app.py - Flask API → Model training: starts retraining
app.py - Model training → Training data loader: loads data
train_models.py - Model training → Saved classifiers: writes classifiers
train_models.py - Game history storage → Training data loader: provides history
connect_db.py - Streamlit launcher → Game history storage: sets up table
main.py - Streamlit launcher → Model training: runs training
main.py - Streamlit launcher → Streamlit game: starts app
main.py