Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amaan-kazi/website-tictactoe
Tic Tac Toe with Local Player vs Player, bot, Online Player vs Player
https://github.com/amaan-kazi/website-tictactoe
minimax-algorithm online-tictactoe-game tic-tac-toe tic-tac-toe-bot website x-and-o
Last synced: about 1 month ago
JSON representation
Tic Tac Toe with Local Player vs Player, bot, Online Player vs Player
- Host: GitHub
- URL: https://github.com/amaan-kazi/website-tictactoe
- Owner: Amaan-Kazi
- Created: 2024-06-16T19:58:43.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T09:23:41.000Z (7 months ago)
- Last Synced: 2024-11-09T15:36:12.258Z (3 months ago)
- Topics: minimax-algorithm, online-tictactoe-game, tic-tac-toe, tic-tac-toe-bot, website, x-and-o
- Language: JavaScript
- Homepage: https://tictactoe.amaankazi.is-a.dev
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tic Tac Toe
This project features:
1. Player Vs Player (Local)
2. Player Vs Bot (MiniMax Algorithm)
3. Player Vs Player (Online)## Player Vs Player (Local)
Round 1: X starts
Round 2: O starts
Starting player is alternated this way
## Player Vs Bot (MiniMax Algorithm)
Bot is always X and starts first in round 1, then starting player is alternated
The bot is made using [Minimax Algorithm](https://en.wikipedia.org/wiki/Minimax) and always plays the perfect move resulting in a win or draw on the highest difficulty, It evaluates every possible move and chooses the the move with the highest score, assuming the opponent will play optimally
## Player Vs Player (Online)
To avoid using a backend server, the data is sent throug [PubNub](https://www.pubnub.com/) channels (Rooms)
Each player has a unique username and can choose to create or join a room with a randomly generated 5 Letter (Upper and Lower Case) room code
The player who creates the room is always X and is the starting player in the first round