https://github.com/pasek108/tictactoe
Three tic-tac-toe versions in two modes. Playable vsvs AI, vs player locally and multiplayer in real-time
https://github.com/pasek108/tictactoe
alpha-beta-pruning flask minimax-algorithm socket-io tic-tac-toe tic-tac-toe-multiplayer
Last synced: 29 days ago
JSON representation
Three tic-tac-toe versions in two modes. Playable vsvs AI, vs player locally and multiplayer in real-time
- Host: GitHub
- URL: https://github.com/pasek108/tictactoe
- Owner: Pasek108
- Created: 2023-03-26T16:46:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-29T13:16:57.000Z (about 1 month ago)
- Last Synced: 2026-04-29T15:26:21.498Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://tic-tac-toe-alqu.onrender.com
- Size: 2.57 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TicTacToe
A web-based Tic-Tac-Toe application featuring different game rules, local play, and real-time multiplayer functionality.
# Overview :sparkles:
## About
This project is a collection of Tic-Tac-Toe variations built to practice full-stack development. It combines a JavaScript-based front-end with a Python back-end to handle real-time game states across different clients. Players can test different game modes against an AI, locally on one device, or online against others.
Check out the [live version](https://pasek108.github.io/BeFunge93Interpreter/).

## Technologies
Languages:
- HTML 5
- CSS 3
- JavaScript
- Python 3.11
Libraries and frameworks:
- [SCSS](https://sass-lang.com)
- [FontAwesome](https://fontawesome.com) 6.2.1
- [GoogleFonts](https://fonts.google.com)
- [Socekt.IO](https://socket.io) 4.6.0
- [Flask](https://flask.palletsprojects.com/en/3.0.x/)
- [Flask SocketIO](https://flask-socketio.readthedocs.io/en/latest/)
## Features
### Game Rules & Modes
* **Multiple Rulesets:** Play the **Standard** game (connect a line to win) or **Reversed** (avoid making a line).
* **Game Variations:**
* **Normal:** The classic 3x3 experience.
* **Movable:** Players move their existing marks on the grid after a certain limit is reached.
* **One Mark:** A simplified version using only one mark per player.
* **Customization:** Adjustable board sizes, starting player selection, and player icons.
### Ways to Play
* **AI Opponent:** Play solo against a basic computer player.
* **Local Play:** Two players can play on the same device.
* **Online Multiplayer:** Real-time matches via WebSockets, including a public lobby and private, password-protected rooms.
### Additional Functionality
* **State Management:** Automatic handling of player disconnections in online rooms.
* **Localization:** Full UI support for both English and Polish.
# Details :scroll:
## User interface
### Every page
On every page there is:
- Header:
- Title which is a link to the main menu page
- Language selection box that allows the user to change the language of the page without reloading
- Footer
- Link to my github
### Main menu

Main menu is basically a form for creating a game.
Click on the multiplayer option will take the player to the multiplayer lobby.
Click on the back option will take the player to the previous step.

Creating a game is a 3-step form:
1. Enemy (AI or player on the same device) and game mode
2. Starting player and type of game (standard, reversed)
3. Board size, players marks, changing sides every game
### Multiplayer lobby

The lobby shows all existing games in the form of a list of rooms that the player can join or create a new one. When there is no players in the room, the room is deleted. If the room is full player can't join until some place becomes available. In that case the join button is disabled. Rooms protected by password has a join button with a lock icon. After clicking it player has to put the correct password in order to join to the game.
Each of the rooms in the lobby has:
- Unique ID
- Name consisting of:
- Mode
- Players marks
- Board size
- Type of a game
- Number of players in the room
- Join button

Creating a game is similar to creating a game in the main menu. The difference is that it is packed in one form and has option for setting password.
Player has to choose:
- Game mode
- Board size
- Type (uncheck = standard, check = reversed)
- Password (empty = no password)
- Players marks
- Starting player
- Switching sides every game
### Game
In game view has:
- Message info (player's turn, waiting for player in mulitplayer)
- Players info (marks of the players, which player is the user)
- Game board (with line in column, row or diagonal if one of the players win)
- Game info (name, marks, board size, type)
- Quit and Replay buttons (replay button is disabled until the game is over)
**Normal game**

Normal version of the tic tac toe, users puts their marks and try to make or avoid making a line depending on game type.
**Movable game**

In beginning players puts their mark like in normal game but after some moves they can't put more marks and they have to move already placed marks.
The game has moves limit which is reached results in a draw.
**One mark game**

Similar to normal version but both of the players have the same mark.
### Multiplayer game
Games in multiplayer are the same as normal games, the only differences are:
- Position of a player will be hilighted in red color if there is no given player or the player left the game
- If there is no enemy player the game will be stopped on unactive player turn.
- On the bottom there is a room id and button to copy invitation link.
Password in invitation link is passed in the URL.
When both players leave the game, the room and its game is deleted.