This is A simple game of Tic-Tac-Toe game in Leo for demo purposes only.
⭕ ❕ ⭕ ❕ ❌
➖ ➕ ➖ ➕ ➖
⭕ ❕ ❌ ❕ ⭕
➖ ➕ ➖ ➕ ➖
❌ ❕ ❌ ❕ ⭕
leo 1.10.0 - https://developer.aleo.org/getting_started/#13-install-leo Ubuntu 22.04 (tested)
git clone https://github.com/nvthaovn/Aleo-TicTacToe.git
cd Aleo-TicTacToe
cp .env.sample .env
edit .env file to config your Aleo private key.
Leo provides users with a command line interface for compiling and running Leo programs.
Users may either specify input values via the command line or provide an input file in inputs/
.
- Run
leo run <function_name> <input_1> <input_2> ...
See ./run.sh
for an example.
- Modify
inputs/tictactoe.in
with the desired inputs. - Run
leo run <function_name>
leo execute <function_name> <input_1> <input_2> ...
leo run new
0 | 0 | 0 |
0 | 0 | 0 |
0 | 0 | 0 |
leo run make_move 1u8 1u8 1u8 "{ r1: { c1: 0u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }"
1 | 0 | 0 |
0 | 0 | 0 |
0 | 0 | 0 |
leo run make_move 2u8 2u8 2u8 "{ r1: { c1: 1u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }"
1 | 0 | 0 |
0 | 2 | 0 |
0 | 0 | 0 |