How tahmidulkhan24/tic-tac-toe works
Tic Tac Toe AI is a Django web game with a browser-based board and an AI opponent. A player interacts with the game UI; the JavaScript sends the board and selected difficulty to Django’s move endpoint, which calls the game AI and returns a move for the UI to apply. The AI supports random Easy play, mixed Medium play, and Minimax-backed Hard play. The README also describes score tracking and a delayed AI response, implemented in the browser. The map focuses on runtime behavior; unsampled template details are not inferred.
Main entry points: views.py Move Endpoint · urls.py Game Routes · app.js Board and Scores · ai.py Difficulty Strategies
Components 9
Django Web
- Project Routes
tic_tac_ai/urls.py - Game Routes
game/urls.py - Home View
game/views.py - Move Endpoint
game/views.py
Browser Game
- Game Page
game/templates/game/home.html - Board and Scores
game/static/game/app.js
AI Logic
- Difficulty Strategies
game/ai.py - Minimax Search
game/ai.py
Other components
- Player
Connections 9
- Project Routes → Game Routes: includes routes
tic_tac_ai/urls.py - Game Routes → Home View: routes home
game/urls.py - Game Routes → Move Endpoint: routes moves
game/urls.py - Home View → Game Page: renders page
game/views.py - Player → Board and Scores: plays game
- Board and Scores → Move Endpoint: posts board
game/static/game/app.js - Move Endpoint → Difficulty Strategies: selects move
game/views.py - Difficulty Strategies → Minimax Search: uses smart move
game/ai.py - Board and Scores → Move Endpoint: receives move
game/static/game/app.js