Skip to content

Commit

Permalink
improve leo example readme's and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Aug 14, 2023
1 parent 7df795b commit b971c34
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
15 changes: 0 additions & 15 deletions .circleci/leo-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,4 @@

# Run the mint_public function.
$LEO run mint_public || exit

# Run the mint_private function.
$LEO run mint_private || exit

# Run the transfer_public function.
$LEO run transfer_public || exit

# Run the transfer_private function.
$LEO run transfer_private || exit

# Run the transfer_private_to_public function.
$LEO run transfer_private_to_public || exit

# Run the transfer_public_to_private function.
$LEO run transfer_public_to_private || exit
)
32 changes: 32 additions & 0 deletions examples/tictactoe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,35 @@ leo run <function_name>
```bash
leo execute <function_name> <input_1> <input_2> ...
```

## Playing the Game

### 1. Create a new game board
```bash
leo run new
```
| | | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |

### 2. Player 1 makes a move
```bash
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 |

### 3. Player 2 makes a move
```bash
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 |
4 changes: 2 additions & 2 deletions examples/tictactoe/inputs/tictactoe.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ player: u8 = 1u8;
row: u8 = 1u8;
col: u8 = 1u8;
board: Board = Board {
r1: Row { c1: 0u8, c2: 1u8, c3: 1u8 },
r2: Row { c1: 2u8, c2: 2u8, c3: 0u8 },
r1: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
r2: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
r3: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
};

11 changes: 2 additions & 9 deletions examples/token/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@ A transparent & shielded custom token in Leo.

To run this program, run:
```bash
leo run main
```

## Execute Guide

To execute this program, run:
```bash
leo execute main
```
./run.sh
```

0 comments on commit b971c34

Please sign in to comment.