An on-chain TicTacToe game, where two players compete to align 3 markers in a row. The game consists of a 3x3 grid. The game has been won if three markers were aligned in a row. Otherwise, it's a draw.
More information can be found in the specification.
The project consists of a smart contract.
TicTacToe
├── project
│ ├────── contracts
│ │ └────── tictactoe-contract
│ │ ├────── src/main.sw
│ │ └────── tests/harness.rs
│ ├────── README.md
│ └────── SPECIFICATION.md
├── app
│ ├────── package.json
│ ├────── index.html
│ └────── src/main.tsx
└── README.md
In order to run the subsequent commands change into the following directory /path/to/TicTacToe/packages/app/<here>
.
pnpm install
pnpm project-setup
You will need to install the Fuel wallet in order to interact with the application. Now you can open your browser and interact with the tic-tac-toe contract through the frontend. To play connect two of your wallet accounts and switch between them so each can take their turn. If you want to run this locally you will need to modify the chainConfig.json
file to fund your wallet locally. Add your wallet address and give it some amount of asset id 0x0000...0000.
In order to run the subsequent commands change into the following directory /path/to/TicTacToe/packages/project/<here>
.
forc build --locked
Before running the tests the programs must be compiled with the command above.
cargo test --locked