Skip to content

Latest commit

 

History

History
 
 

TicTacToe

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

SwayApps TicTacToe Logo

Overview

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.

Project structure

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

Running the project

User interface

In order to run the subsequent commands change into the following directory /path/to/TicTacToe/packages/app/<here>.

Run the frontend application

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.

Project

In order to run the subsequent commands change into the following directory /path/to/TicTacToe/packages/project/<here>.

Program compilation

forc build --locked

Running the tests

Before running the tests the programs must be compiled with the command above.

cargo test --locked