Skip to content

Commit

Permalink
code comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Aug 22, 2023
1 parent 337b2c9 commit 0f628f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/tutorial/onchain-chess/0-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Create a `systems` folder at `src`. Create `initiate.cairo`and `move.cairo` two

For example, `initiate.cairo` look like this:

```rust
```rust,ignore
#[system]
mod initiate_system {
Expand All @@ -92,15 +92,15 @@ mod initiate_system {

and in `systems.cairo` we will use `initiate_system` like this:

```rust
```rust,ignore
mod initiate;
use initiate::initiate_system;
```

Do the same with the other systems. Update `systems.cairo` to:

```rust
```rust,ignore
mod initiate;
mod move;
Expand Down
12 changes: 6 additions & 6 deletions src/tutorial/onchain-chess/4-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Before we get to the code, set up your integration test like this:

## Full Code

```rust
```rust,ignore
#[cfg(test)]
mod tests {
use starknet::ContractAddress;
Expand Down Expand Up @@ -144,14 +144,14 @@ mod tests {

First, we'll set up the players and their colors.

```rust
```rust,ignore
let white = starknet::contract_address_const::<0x01>();
let black = starknet::contract_address_const::<0x02>();
```

We should list both Components and Systems in arrays, with each having CLASS_HASH as elements.

```rust
```rust,ignore
// components
let mut components = array::ArrayTrait::new();
components.append(game::TEST_CLASS_HASH);
Expand All @@ -166,13 +166,13 @@ systems.append(move_system::TEST_CLASS_HASH);

Next, we'll create our game world.

```rust
```rust,ignore
let world = spawn_test_world(components, systems);
```

We use `initiate_system` to put our Square pieces on the board. Each Square holds a piece. The system's execute function needs some input, which we give it as calldata.

```rust
```rust,ignore
// initiate
let mut calldata = array::ArrayTrait::<core::felt252>::new();
calldata.append(white.into());
Expand All @@ -195,7 +195,7 @@ Let's check if a White pawn is at (0,1). Remember, to get a piece that exists on
After setting up the board, use `move_system` to make moves. Provide the current position, the next position, the player's address, and the game id.

```rust
```rust,ignore
//Move White Pawn to (0,3)
let mut move_calldata = array::ArrayTrait::<core::felt252>::new();
move_calldata.append(0);
Expand Down

0 comments on commit 0f628f5

Please sign in to comment.