Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nasermirzaei89/tictactoe
Tic Tac Toe game in Golang + WASM
https://github.com/nasermirzaei89/tictactoe
board-game game game-development golang wasm webassembly
Last synced: 25 days ago
JSON representation
Tic Tac Toe game in Golang + WASM
- Host: GitHub
- URL: https://github.com/nasermirzaei89/tictactoe
- Owner: nasermirzaei89
- License: mit
- Created: 2020-05-22T09:12:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T13:35:23.000Z (about 4 years ago)
- Last Synced: 2024-11-11T12:21:11.355Z (3 months ago)
- Topics: board-game, game, game-development, golang, wasm, webassembly
- Language: JavaScript
- Homepage: https://nasermirzaei89.net/tictactoe/
- Size: 1.74 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tic Tac Toe
## Run in Terminal
### Build
`make build-terminal`### Run
`./bin/terminal`> ~~In this mode computer is unbeatable AI.~~ In this update you can select user input / unbeatable / random
> No external package used.
## Run in Browser
`make run-server`
Then goto http://127.0.0.1:8080
## AIs
### Unbeatable AI
I use [MiniMax Algorithm](https://en.wikipedia.org/wiki/Minimax) to write this AI.
I found 3 other algorithms as below:
1. Tabular Q-Learning
1. MCTS
1. Neural NetworkBut I implemented minimax only :D
### Random AI
This AI randomly select an available box to play.
## Test AIs
I wrote 3 games in [test](./selector/ai_test.go):
1. Unbeatable AI versus Unbeatable AI (No one can beat each other)
1. Unbeatable (as X) versus (as O) (Random can't beat Unbeatable)
1. Random (as X) versus Unbeatable (as O) (Random can't beat Unbeatable)I ran these tests 1000 times:
`go test -count 1000`
and no one failed.