Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raklaptudirm/wreck
Perfect Tic-Tac-Toe Engine
https://github.com/raklaptudirm/wreck
engine tic-tac-toe
Last synced: 20 days ago
JSON representation
Perfect Tic-Tac-Toe Engine
- Host: GitHub
- URL: https://github.com/raklaptudirm/wreck
- Owner: raklaptudirm
- License: apache-2.0
- Created: 2022-05-25T04:46:45.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-11T17:41:55.000Z (over 2 years ago)
- Last Synced: 2024-12-05T21:36:21.870Z (about 1 month ago)
- Topics: engine, tic-tac-toe
- Language: Go
- Homepage: https://laptudirm.com/x/wreck
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# The Wreck Tic-Tac-Toe Engine
Wreck is a tic-tac-toe analysis engine which is capable of perfect play,
i.e, it can win any winnable, and defend any defendable position. A full
game played against Wreck will either end in a draw or a win for Wreck.### Installation
``` bash
go install laptudirm.com/x/wreck/cmd/wreck@latest
```### Usage
#### Main Command
```bash
wreck [position]
```#### REPL Commands
```bash
wreck :: help # help regarding commands and the repl
wreck :: load # load this position into the engine
wreck :: play # play the provided move on the current position
wreck :: eval # evaluate current position
wreck :: exit # exit from program
```### Evaluation
Wreck evaluates position as a number. An evaluation of `±00` means the
position is equal, and perfect play will result in a draw. An evaluation
starting with a `+`, like `+Wn` means means player `X` will win in `n`
steps, and an evaluation starting with `-` means player `O` will win in `n`
steps.### Position Strings
A tic tac toe position is represented by a 9-character long position string
which is composed of `x`, `o`, and `.` symbols. Each of the nine characters
represents one of the cells on a tic tac toe board, and the symbols represent
a mark by player `X`, a mark by player `O`, and an empty cell respectively.```
Any tic-tac-toe position:
1 2 3 x o .
4 5 6 x . .
7 8 9 o . .Is represented in the following format:
123456789
xo.x..o..
```### Moves
A move on the tic tac toe board which is at a particular position is
represented by a number from 1-9, each of which represent a particular cell
on the board.