A browser-based Tic Tac Toe game built with vanilla JavaScript as part of
The Odin Project โ JavaScript Course (Full Stack JavaScript Path).
This project focuses on organizing JavaScript code using factory functions and the module pattern (IIFE) while maintaining a clean separation between game logic and DOM manipulation.
๐ https://top-submissions.github.io/fullstackjs-tic-tac-toe/
This is a two-player Tic Tac Toe game playable in the browser.
Players can enter custom names, play multiple rounds, track wins and ties, restart games, and reset scores.
The project was built to practice:
- Modular JavaScript architecture
- Avoiding global variables
- Managing application state
- DOM interaction without frameworks
- Two-player Tic Tac Toe (X vs O)
- Custom player name input
- Win detection (rows, columns, diagonals)
- Tie detection
- Scoreboard tracking wins and ties
- Restart game without resetting scores
- Reset scores button
- Winning combination highlighting
- Responsive and modern UI
- GitHub Pages deployment
- HTML5
- CSS3
- JavaScript (ES6)
- Factory Functions
- Module Pattern (IIFE)
- DOM Manipulation
- GitHub Pages
- Enter player names (optional).
- Click Start Game.
- Players take turns clicking empty cells.
- First player to align three markers wins.
- A tie is declared if the board fills with no winner.
- Use Restart Game to play again.
- Use Reset Scores to clear the scoreboard.
The game is organized into clear modules:
-
GameBoard Module Manages the board state and win/tie detection.
-
Player Factory Creates player objects with name, marker, and score.
-
GameController Module Controls game flow, turn switching, scoring, and win logic.
-
DisplayController Module Handles DOM rendering, UI updates, and user interaction.
This structure follows best practices taught in The Odin Project.
- Structuring JavaScript projects using modules
- Separating logic from presentation
- Managing state without frameworks
- Writing maintainable, readable code
- Using GitHub Actions and GitHub Pages
- Single-player mode with AI
- Difficulty selection
- Persistent scores using
localStorage - Sound effects and animations
- Mobile-first UI refinements
MatimotTheTimoters GitHub: https://github.com/Chonky_Seal