`
- The external url of the server, used for configuring the GraphQL Playground in a hosted environment
-
-`-h, --help`
- Print help
-
-`-V, --version`
- Print version
diff --git a/0.3.0/src/tutorial/onchain-chess/0-setup.md b/0.3.0/src/tutorial/onchain-chess/0-setup.md
deleted file mode 100644
index d11a9c91..00000000
--- a/0.3.0/src/tutorial/onchain-chess/0-setup.md
+++ /dev/null
@@ -1,331 +0,0 @@
-# 0. Setup
-
-_Before starting recommend following the [`hello-dojo`](../../cairo/hello-dojo.md) chapter to gain a basic understanding of the Dojo game._
-
-## Initializing the Project
-
-Create a new Dojo project folder. You can name your project what you want.
-
-```sh
-mkdir dojo-chess
-```
-
-Open the project folder.
-
-```sh
-cd dojo-chess
-```
-
-And initialize the project using sozo init.
-
-```sh
-sozo init
-```
-
-## Cleaning Up the Boilerplate
-
-The project comes with a lot of boilerplate codes. Clear it all. Make sure both `models.cairo` and `systems.cairo` files are empty. In this tutorial, we won't be creating a `systems.cairo` nor the `src/systems` folder, you can delete both (highly optional, folder structure is entirely up to you). instead, we'll be creating a file named `actions_contract.cairo`, this is where our game logic/contract will reside.
-
-Remodel your`lib.cairo`, to look like this :
-
-```rust,ignore
-mod models;
-mod actions_contract;
-mod tests;
-```
-
-Compile your project with:
-
-```sh
-sozo build
-```
-
-## Basic components
-
-While there are many ways to design a chess game using the ECS model, we'll follow this approach:
-
-> Every square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square, the square entity will hold that piece.
-
-First, add this basic model to `models.cairo` file. If you are not familar with model syntax in Dojo engine, go back to this [chapter](../../cairo/models.md).
-
-```rust,ignore
-#[derive(Model)]
-struct Square {
- #[key]
- game_id: felt252,
- #[key]
- x: u32,
- #[key]
- y: u32,
- piece: PieceType,
-}
-
-enum PieceType {
- WhitePawn : (),
- WhiteKnight: (),
- WhiteBishop: (),
- WhiteRook: (),
- WhiteQueen: (),
- WhiteKing: (),
- BlackPawn: (),
- BlackKnight: (),
- BlackBishop: (),
- BlackRook: (),
- BlackQueen: (),
- BlackKing: (),
- None: ()
-}
-```
-
-## Basic systems
-
-Starting from the next chapter, you will implement the `actions_contract.cairo` logic.
-
-Create `actions_contract.cairo` inside the src folder. the file should contain a basic contract.
-
-For example, `actions_contract.cairo` should look like this:
-
-```rust,ignore
-#[starknet::contract]
-mod actions {
-
- #[storage]
- struct Storage {}
-}
-```
-It should be noted that systems are cairo contracts, by implication, rather than implementing the game logic in systems, we are implementing it in a contract.
-
-## Compile your project
-
-Now try `sozo build` to build. Faced some errors?
-
-```sh
-error: Trait has no implementation in context:
-```
-
-You would probably faced some trait implementation errors, which you can implement as a derive like:
-
-```rust,ignore
-
-#[derive(Model, Drop, Serde)]
-struct Square {
- #[key]
- game_id: felt252,
- #[key]
- x: u32,
- #[key]
- y: u32,
- piece: PieceType,
-}
-
-#[derive(Serde, Drop, Copy, PartialEq, Introspect)]
-enum PieceType {
- WhitePawn: (),
- WhiteKnight: (),
- WhiteBishop: (),
- WhiteRook: (),
- WhiteQueen: (),
- WhiteKing: (),
- BlackPawn: (),
- BlackKnight: (),
- BlackBishop: (),
- BlackRook: (),
- BlackQueen: (),
- BlackKing: (),
- None: (),
-}
-```
-
-Complied? Great! then let's move on. If not fix other issues as above, so that you can run the `sozo build` command successfully.
-
-## Run test
-
-Before proceeding to the next chapter, remember that `sozo build` and `sozo test` are important steps to ensure your code is correct.
-
-Run sozo test. Did you face any errors?
-
-```sh
-error: Trait has no implementation in context:
-```
-
-```sh
-error: Variable not dropped. Trait has no implementation in context:
-```
-
-For the no implementation error, implement the PrintTrait to run `sozo test` successfully. For the not dropped error, add the Drop trait. Address other errors by adding derives or implementing them on a case-by-case basis.
-
-## Add more models
-
-Before you move on, add more models so we can use them in the next chapter when creating the action contract.
-
-### Requirements
-
-- `Color` enum with values White,Black & None
-```rust,ignore
- White: (),
- Black: (),
- None: (),
-```
-
-- `Game` model:
-```rust,ignore
- game_id: felt252,
- winner: Color,
- white: ContractAddress,
- black: ContractAddress
-```
-
-- `GameTurn` model:
-```rust,ignore
- game_id: felt252,
- turn: Color
-```
-
-- Run `sozo build` to see if your code compiles, we'll handle `test` implementiation in the subsequent chapters.
-
-This tutorial is extracted from [here](https://github.com/Akinbola247/chess-dojo/tree/tutorialv3)
-
-
-Click to see full `models.cairo` code
-
-```rust,ignore
-use array::ArrayTrait;
-use debug::PrintTrait;
-use starknet::ContractAddress;
-use dojo::database::schema::{SchemaIntrospection, Ty, Enum, serialize_member_type};
-
-
-#[derive(Model, Drop, Serde)]
-struct Square {
- #[key]
- game_id: felt252,
- #[key]
- x: u32,
- #[key]
- y: u32,
- piece: PieceType,
-}
-
-#[derive(Serde, Drop, Copy, PartialEq, Introspect)]
-enum PieceType {
- WhitePawn: (),
- WhiteKnight: (),
- WhiteBishop: (),
- WhiteRook: (),
- WhiteQueen: (),
- WhiteKing: (),
- BlackPawn: (),
- BlackKnight: (),
- BlackBishop: (),
- BlackRook: (),
- BlackQueen: (),
- BlackKing: (),
- None: (),
-}
-
-#[derive(Serde, Drop, Copy, PartialEq, Introspect)]
-enum Color {
- White: (),
- Black: (),
- None: (),
-}
-
-#[derive(Model, Drop, Serde)]
-struct Game {
- /// game id, computed as follows pedersen_hash(player1_address, player2_address)
- #[key]
- game_id: felt252,
- winner: Color,
- white: ContractAddress,
- black: ContractAddress
-}
-
-#[derive(Model, Drop, Serde)]
-struct GameTurn {
- #[key]
- game_id: felt252,
- turn: Color
-}
-
-
-//printing trait for debug
-impl ColorPrintTrait of PrintTrait {
- #[inline(always)]
- fn print(self: Color) {
- match self {
- Color::White(_) => {
- 'White'.print();
- },
- Color::Black(_) => {
- 'Black'.print();
- },
- Color::None(_) => {
- 'None'.print();
- },
- }
- }
-}
-
-
-impl BoardPrintTrait of PrintTrait<(u32, u32)> {
- #[inline(always)]
- fn print(self: (u32, u32)) {
- let (x, y): (u32, u32) = self;
- x.print();
- y.print();
- }
-}
-
-
-impl PieceTypePrintTrait of PrintTrait {
- #[inline(always)]
- fn print(self: PieceType) {
- match self {
- PieceType::WhitePawn(_) => {
- 'WhitePawn'.print();
- },
- PieceType::WhiteKnight(_) => {
- 'WhiteKnight'.print();
- },
- PieceType::WhiteBishop(_) => {
- 'WhiteBishop'.print();
- },
- PieceType::WhiteRook(_) => {
- 'WhiteRook'.print();
- },
- PieceType::WhiteQueen(_) => {
- 'WhiteQueen'.print();
- },
- PieceType::WhiteKing(_) => {
- 'WhiteKing'.print();
- },
- PieceType::BlackPawn(_) => {
- 'BlackPawn'.print();
- },
- PieceType::BlackKnight(_) => {
- 'BlackKnight'.print();
- },
- PieceType::BlackBishop(_) => {
- 'BlackBishop'.print();
- },
- PieceType::BlackRook(_) => {
- 'BlackRook'.print();
- },
- PieceType::BlackQueen(_) => {
- 'BlackQueen'.print();
- },
- PieceType::BlackKing(_) => {
- 'BlackKing'.print();
- },
- PieceType::None(_) => {
- 'None'.print();
- },
- }
- }
-}
-
-```
-
-
-
-Congratulations! You've completed the basic setup for building an on-chain chess game π
diff --git a/0.3.0/src/tutorial/onchain-chess/1-action.md b/0.3.0/src/tutorial/onchain-chess/1-action.md
deleted file mode 100644
index 28c211aa..00000000
--- a/0.3.0/src/tutorial/onchain-chess/1-action.md
+++ /dev/null
@@ -1,246 +0,0 @@
-# 1. Action_Contract
-
-This chapter will address implementing `action_contract.cairo`, which spawns the game & squares containing pieces and also allow players to move pieces.
-
-## What is `action_contract`?
-
-To play chess, you need, to start game, spawn the pieces, and move around the board. the `action_contract` has two dominant functions `spawn_game` function which spawns the game entity and places each
-piece in its proper position on the board and the `move` funtion which allows pieces to be moved around the board.
-
-
-
-
-## Requirements
-
-_Copy the unit tests below and paste them at the bottom of your `action_contract.cairo` file._
-
-1. Write an interface for the `initiate_system` contract and define your functions. In this case, `move` and `spawn_game`
-```shell
- #[starknet::interface]
- trait IActions {
- fn move(
- self: @ContractState,
- curr_position: (u32, u32),
- next_position: (u32, u32),
- caller: ContractAddress, //player
- game_id: felt252
- );
- fn spawn_game(
- self: @ContractState, white_address: ContractAddress, black_address: ContractAddress,
- );
- }
-```
-2. Bring in required imports into the contract and initialize storage with the `world_dispatcher` in it like this :
-```shell
- #[starknet::contract]
- mod actions {
- use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
- use debug::PrintTrait;
- use starknet::ContractAddress;
- use dojo_chess::models::{Color, Square, PieceType, Game, GameTurn};
- use super::IActions;
-
- #[storage]
- struct Storage {
- world_dispatcher: IWorldDispatcher,
- }
- }
-```
-should be noted that `actions` is the contract name.
-
-3. Write a `spawn_game` function that accepts the `white address`, and `black address` as input and set necessary states using `set!(...)`.Implement the game entity, comprised of the `Game` model and `GameTurn` model we created in the `models.cairo` and Implement the square entities from a1 to h8 containing the correct `PieceType` in the `spawn_game` fn.
-```shell
- #[external(v0)]
- impl PlayerActionsImpl of IActions {
- fn spawn_game(
- self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
- ) {
- let world = self.world_dispatcher.read();
- let game_id = pedersen::pedersen(white_address.into(), black_address.into());
- set!(
- world,
- (
- Game {
- game_id: game_id,
- winner: Color::None(()),
- white: white_address,
- black: black_address,
- }, GameTurn {
- game_id: game_id, turn: Color::White(()),
- },
- )
- );
-
- set!(world, (Square { game_id: game_id, x: 0, y: 0, piece: PieceType::WhiteRook }));
-
- set!(world, (Square { game_id: game_id, x: 0, y: 1, piece: PieceType::WhitePawn }));
-
- set!(world, (Square { game_id: game_id, x: 1, y: 6, piece: PieceType::BlackPawn }));
-
- set!(world, (Square { game_id: game_id, x: 1, y: 0, piece: PieceType::WhiteKnight }));
-
- //the rest of the positions on the board goes here....
- }
-```
-4. Write a `move` function that accepts the `current position`, `next position`, `caller address`, and `game id`. The `move` function should look like this:
-```shell
- fn move(
- self: @ContractState,
- curr_position: (u32, u32),
- next_position: (u32, u32),
- caller: ContractAddress, //player
- game_id: felt252
- ) {
- let world = self.world_dispatcher.read();
-
- let (current_x, current_y) = curr_position;
- let (next_x, next_y) = next_position;
- current_x.print();
- current_y.print();
-
- next_x.print();
- next_y.print();
-
- let mut current_square = get!(world, (game_id, current_x, current_y), (Square));
-
- // check if next_position is out of board or not
- assert(is_out_of_board(next_position), 'Should be inside board');
-
- // check if this is the right piece type move
- assert(
- is_right_piece_move(current_square.piece, curr_position, next_position),
- 'Should be right piece move'
- );
- let target_piece = current_square.piece;
- // make current_square piece none and move piece to next_square
- current_square.piece = PieceType::None(());
- let mut next_square = get!(world, (game_id, next_x, next_y), (Square));
-
- // check the piece already in next_suqare
- let maybe_next_square_piece = next_square.piece;
-
- if maybe_next_square_piece == PieceType::None(()) {
- next_square.piece = target_piece;
- } else {
- if is_piece_is_mine(maybe_next_square_piece) {
- panic(array!['Already same color piece exist'])
- } else {
- next_square.piece = target_piece;
- }
- }
-
- set!(world, (next_square));
- set!(world, (current_square));
- }
- //helper functions within the fn move. don't worry, we'll address logic content in the next chapter
- fn is_piece_is_mine(maybe_piece: PieceType) -> bool {
- //the rest of the code ....
- }
- fn is_correct_turn(maybe_piece: PieceType, caller: ContractAddress, game_id: felt252) -> bool {
- //the rest of the code ....
- }
- fn is_out_of_board(next_position: (u32, u32)) -> bool {
- //the rest of the code ....
- }
- fn is_right_piece_move(maybe_piece: PieceType, curr_position: (u32, u32), next_position: (u32, u32)) -> bool {
- //the rest of the code ....
- }
- }
-```
-7. Run `sozo test` and pass all the tests.
-
-## Test Flow
-
-- Spawn the test world (`spawn_test_world`) that imports the models in testing.
-- deploy actions contract
-- interact with `spawn_game` function in the `actions` contract by providing white and black player's wallet addresses as inputs.
-- Retrieve the game entity and piece entity created in `actions` contract.
-- Ensure the game has been correctly created.
-- Verify that each `Piece` is located in the correct `Square`.
-
-## Unit Tests
-
-```rust,ignore
-#[cfg(test)]
-mod tests {
- use starknet::ContractAddress;
- use dojo::test_utils::{spawn_test_world, deploy_contract};
- use dojo_chess::models::{Game, game, GameTurn, game_turn, Square, square, PieceType};
-
- use dojo_chess::actions_contract::actions;
- use starknet::class_hash::Felt252TryIntoClassHash;
- use dojo::world::IWorldDispatcherTrait;
- use dojo::world::IWorldDispatcher;
- use core::array::SpanTrait;
- use super::{IActionsDispatcher, IActionsDispatcherTrait};
-
- // helper setup function
- // reusable function for tests
- fn setup_world() -> (IWorldDispatcher, IActionsDispatcher) {
- // models
- let mut models = array![
- game::TEST_CLASS_HASH, game_turn::TEST_CLASS_HASH, square::TEST_CLASS_HASH
- ];
- // deploy world with models
- let world = spawn_test_world(models);
-
- // deploy systems contract
- let contract_address = world
- .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
- let actions_system = IActionsDispatcher { contract_address };
-
- (world, actions_system)
- }
-
- #[test]
- #[available_gas(3000000000000000)]
- fn test_initiate() {
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
-
- let (world, actions_system) = setup_world();
-
- //system calls
- actions_system.spawn_game(white, black);
- let game_id = pedersen::pedersen(white.into(), black.into());
-
- //get game
- let game = get!(world, game_id, (Game));
- assert(game.white == white, 'white address is incorrect');
- assert(game.black == black, 'black address is incorrect');
-
- //get a1 square
- let a1 = get!(world, (game_id, 0, 0), (Square));
- assert(a1.piece == PieceType::WhiteRook, 'should be White Rook');
- assert(a1.piece != PieceType::None, 'should have piece');
- }
-
-
- #[test]
- #[available_gas(3000000000000000)]
- fn test_move() {
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
-
- let (world, actions_system) = setup_world();
- actions_system.spawn_game(white, black);
-
- let game_id = pedersen::pedersen(white.into(), black.into());
-
- let a2 = get!(world, (game_id, 0, 1), (Square));
- assert(a2.piece == PieceType::WhitePawn, 'should be White Pawn');
- assert(a2.piece != PieceType::None, 'should have piece');
-
- actions_system.move((0, 1), (0, 2), white.into(), game_id);
-
- let c3 = get!(world, (game_id, 0, 2), (Square));
- assert(c3.piece == PieceType::WhitePawn, 'should be White Pawn');
- assert(c3.piece != PieceType::None, 'should have piece');
- }
-```
-
-## Need help?
-
-If you're stuck, don't hesitate to ask questions at the [Dojo community](https://discord.gg/akd2yfuRS3)!
-
-You can find the [answer](https://github.com/rkdud007/chess-dojo/blob/tutorialv3/src/actions_contract.cairo) for chapter 1 here.
diff --git a/0.3.0/src/tutorial/onchain-chess/2-legal.md b/0.3.0/src/tutorial/onchain-chess/2-legal.md
deleted file mode 100644
index 0c61b3ce..00000000
--- a/0.3.0/src/tutorial/onchain-chess/2-legal.md
+++ /dev/null
@@ -1,166 +0,0 @@
-# 2. Check Legal Move
-
-In this chapter, we'll make functions to check:
-
-- If the next move goes outside the board.
-- If there's a piece that can be captured.
-- If the next move is allowed for the type of piece.
-- If the user can allow to make a action (based on the piece's color).
-- ... You can also add other custom check functions.
-
-## Make Check Functions
-
-We need to add some check functions in `actions` contract. These will help make sure the next move is allowed.
-
-1. See if player is moving the right piece
-
-```rust,ignore
- fn is_piece_is_mine(maybe_piece: PieceType) -> bool {
- false
- }
-```
-
-2. See if the next spot is still on the board.
-
-```rust,ignore
- fn is_out_of_board(next_position: (u32, u32)) -> bool {
- let (n_x, n_y) = next_position;
- if n_x > 7 || n_x < 0 {
- return false;
- }
- if n_y > 7 || n_y < 0 {
- return false;
- }
- true
- }
-```
-
-3. See if the person trying the move is doing it at the right time and with their piece color.
-
-```rust,ignore
- fn is_correct_turn(maybe_piece: PieceType, caller: ContractAddress, game_id: felt252) -> bool {
- true
- }
-```
-
-4. see if it's the right move
-```rust,ignore
- fn is_right_piece_move(
- maybe_piece: PieceType, curr_position: (u32, u32), next_position: (u32, u32)
- ) -> bool {
- let (c_x, c_y) = curr_position;
- let (n_x, n_y) = next_position;
- match maybe_piece {
- PieceType::WhitePawn => {
- true
- },
- PieceType::WhiteKnight => {
- if n_x == c_x + 2 && n_y == c_x + 1 {
- return true;
- }
-
- panic(array!['Knight illegal move'])
- },
- PieceType::WhiteBishop => {
- true
- },
- PieceType::WhiteRook => {
- true
- },
- PieceType::WhiteQueen => {
- true
- },
- PieceType::WhiteKing => {
- true
- },
- PieceType::BlackPawn => {
- true
- },
- PieceType::BlackKnight => {
- true
- },
- PieceType::BlackBishop => {
- true
- },
- PieceType::BlackRook => {
- true
- },
- PieceType::BlackQueen => {
- true
- },
- PieceType::BlackKing => {
- true
- },
- PieceType::None(_) => panic(array!['Should not move empty square']),
- }
- }
-```
-5. You can also add other check functions to be extra sure the move is allowed.
-
-Once you've made these check functions, you can use them in the `move` function in the contract as illustrated in the previous chapter [here](1-action.md). You can decide how to set them up and which ones to use. We'll give an example to help:
-
-## Testing Each Function
-
-Since we have different check functions, we need to test each one. To make this easier, let's use parts that are the same for many tests.
-
-First, make a helper function called `setup_world`. This will give back an `IWorldDispatcher` and `IActionsDispatcher` that we can use many times in the tests.
-
-```rust,ignore
- #[test]
- #[available_gas(3000000000000000)]
- fn setup_world() -> (IWorldDispatcher, IActionsDispatcher) {
- // models
- let mut models = array![
- game::TEST_CLASS_HASH, game_turn::TEST_CLASS_HASH, square::TEST_CLASS_HASH
- ];
- // deploy world with models
- let world = spawn_test_world(models);
-
- // deploy systems contract
- let contract_address = world
- .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
- let actions_system = IActionsDispatcher { contract_address };
-
- (world, actions_system)
- }
-```
-
-Then, our main `test_move` function will be simpler.
-
-```rust,ignore
- #[test]
- #[available_gas(3000000000000000)]
- fn test_move() {
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
- let (move_system, initate_system) = setup_world();
- let game_id = pedersen(white.into(), black.into());
- // other codes are same
- }
-```
-
-Now we can make tests that show errors if we try moves that aren't allowed. Let's make a `test_piecetype_illegal` function. This will check if the `is_right_piece_move` function, that you implemented in the move system, works right.
-
-```rust,ignore
- #[test]
- #[should_panic]
- fn test_piecetype_ilegal() {
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
- let (world, actions_system) = setup_world();
- let game_id = pedersen::pedersen(white.into(), black.into());
-
- let b1 = get!(world, (game_id, 1, 0), (Square));
- assert(b1.piece == PieceType::WhiteKnight, 'should be White Knight');
-
- // Knight cannot move to that square
- actions_system.move((1,0),(2,3),white.into(), game_id);
- }
-```
-
-Finish by making your tests. These should find wrong moves and give back errors.
-
-## Need help?
-
-If you're stuck, don't hesitate to ask questions at the [Dojo community](https://discord.gg/akd2yfuRS3)!
-
diff --git a/0.3.0/src/tutorial/onchain-chess/3-test.md b/0.3.0/src/tutorial/onchain-chess/3-test.md
deleted file mode 100644
index e4d8aacc..00000000
--- a/0.3.0/src/tutorial/onchain-chess/3-test.md
+++ /dev/null
@@ -1,145 +0,0 @@
- # 3 Test Contract
-
-In this chapter, we'll use everything we've learned to run a full chess game scenario.
-
-Here's what we'll do in our test:
-
-1. Spawn `white_pawn_1` to (0,1)
-2. Move `white_pawn_1` to (0,3)
-3. Move `black_pawn_2` to (1,6)
-4. Move `white_pawn_1` to (0,4)
-5. Move `black_pawn_2` to (1,4)
-6. Move `white_pawn_1` to (1,4)
-7. Capture `black_pawn_2`
-
-To place the pieces, use our `spawn_game` function in our `actions` contract. For moving them, use the `move_system` contract. Remember to check if a piece can be captured when using `move_system`.
-
-Before we get to the code, set up your integration test like this:
-
-- Copy the test below and add it to your `src/tests.cairo` file.
-- Make a `test.cairo` in your src and update `lib.cairo` by adding the `mod tests;` line.
-
-## Full Code
-
-```rust,ignore
-#[cfg(test)]
-mod tests {
- use starknet::ContractAddress;
- use dojo::test_utils::spawn_test_world;
- use dojo_chess::models::{Game, game, GameTurn, game_turn, Square, square, PieceType};
-
- use dojo_chess::actions_contract::actions;
- use array::ArrayTrait;
- use core::traits::Into;
- use dojo::world::IWorldDispatcherTrait;
- use core::array::SpanTrait;
- use dojo_chess::actions_contract::tests::setup_world;
- use dojo_chess::actions_contract::{IActionsDispatcher, IActionsDispatcherTrait};
-
-
- #[test]
- #[available_gas(3000000000000000)]
- fn integration() {
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
-
- let (world, actions_system) = setup_world();
-
- //system calls
- actions_system.spawn_game(white, black);
- let game_id = pedersen::pedersen(white.into(), black.into());
-
- //White pawn is now in (0,1)
- let a2 = get!(world, (game_id, 0, 1), (Square));
- assert(a2.piece == PieceType::WhitePawn, 'should be White Pawn in (0,1)');
- assert(a2.piece != PieceType::None, 'should have piece in (0,1)');
-
- //Black pawn is now in (1,6)
- let b7 = get!(world, (game_id, 1, 6), (Square));
- assert(b7.piece == PieceType::BlackPawn, 'should be Black Pawn in (1,6)');
- assert(b7.piece != PieceType::None, 'should have piece in (1,6)');
-
- //Move White Pawn to (0,3)
- actions_system.move((0, 1), (0, 3), white.into(), game_id);
-
- //White pawn is now in (0,3)
- let a4 = get!(world, (game_id, 0, 3), (Square));
- assert(a4.piece == PieceType::WhitePawn, 'should be White Pawn in (0,3)');
- assert(a4.piece != PieceType::None, 'should have piece in (0,3)');
-
- //Move black Pawn to (1,4)
- actions_system.move((1, 6), (1, 4), white.into(), game_id);
-
- //Black pawn is now in (1,4)
- let b5 = get!(world, (game_id, 1, 4), (Square));
- assert(b5.piece == PieceType::BlackPawn, 'should be Black Pawn in (1,4)');
- assert(b5.piece != PieceType::None, 'should have piece in (1,4)');
-
- // Move White Pawn to (1,4)
- // Capture black pawn
- actions_system.move((0, 3), (1, 4), white.into(), game_id);
-
- let b5 = get!(world, (game_id, 1, 4), (Square));
- assert(b5.piece == PieceType::WhitePawn, 'should be White Pawn in (1,4)');
- assert(b5.piece != PieceType::None, 'should have piece in (1,4)');
- }
-}
-
-```
-
-## Diving into the Code
-First, we'll set up the players and their colors.
-
-```rust,ignore
- let white = starknet::contract_address_const::<0x01>();
- let black = starknet::contract_address_const::<0x02>();
-```
-
-We should list both models with each having CLASS_HASH as elements and then we deploy world to models with `spawn_test_world`
-
-```rust,ignore
-//models
- let mut models = array![game::TEST_CLASS_HASH, game_turn::TEST_CLASS_HASH, square::TEST_CLASS_HASH];
- let world = spawn_test_world(models);
-```
-We then deploy our system contracts in our helper function in `action_contract` file. we only imported it in our test file.
-```rust,ignore
- let contract_address = world
- .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap());
- let actions_system = IActionsDispatcher { contract_address };
-```
-
-We use `spawn_game` function in `actions_contract.cairo` to put our Square pieces on the board. Each Square holds a piece. The system's `spawn_game` function needs some input i.e the addresses of the players.
-
-```rust,ignore
- // spawn
- actions_system.spawn_game(white, black);
-```
-
-Let's check if a White pawn is at (0,1). Remember, to get a piece that exists on the square, you need to use the keys of the `Square` model, which are `game_id`, `x`, and `y`. Do the same check for the Black Pawn.
-
-```rust,ignore
- //White pawn is now in (0,1)
- let a2 = get!(world, (game_id, 0, 1), (Square));
- assert(a2.piece == PieceType::WhitePawn, 'should be White Pawn in (0,1)');
- assert(a2.piece != PieceType::None, 'should have piece in (0,1)');
-```
-
-After setting up the board, use `move` function in the contract to make moves. Provide the current position, the next position, the player's address, and the game id.
-
-```rust,ignore
- //Move White Pawn to (0,3)
- actions_system.move((0, 1), (0, 3), white.into(), game_id);
-```
-
-Keep moving pieces and checking if they're in the right places.
-
-## Congratulations!
-
-You've made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges:
-
-- Add a checkmate feature. Our game doesn't end now, so decide when it should!
-- Include special moves like castling, En Passant Capture, or Pawn Promotion.
-- Make your own chess rules! You could even create your own version of the [immortal game](https://immortal.game/)
-
-Lastly, share your project with others in the [Dojo community](https://discord.gg/akd2yfuRS3)!
diff --git a/0.3.0/src/tutorial/onchain-chess/4-utils.md b/0.3.0/src/tutorial/onchain-chess/4-utils.md
deleted file mode 100644
index 2469b4d2..00000000
--- a/0.3.0/src/tutorial/onchain-chess/4-utils.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# 4. Modularize functions
-In order to keep our code has dry as possible, you can modularize your functions. To do this, we'll create an `utils.cairo` file and add the below:
-```rust,ignore
-use dojo_chess::models::PieceType;
-use starknet::ContractAddress;
-
-fn is_piece_is_mine(maybe_piece: PieceType) -> bool {
- //rest of the code here
-}
-
-fn is_correct_turn(maybe_piece: PieceType, caller: ContractAddress, game_id: felt252) -> bool {
- //rest of the code here
-}
-
-fn is_out_of_board(next_position: (u32, u32)) -> bool {
- //rest of the code here
-}
-
-fn is_right_piece_move(
- maybe_piece: PieceType, curr_position: (u32, u32), next_position: (u32, u32)
-) -> bool {
- //rest of the code here
-
-}
-```
-In your, `action_contracts`, these functions can be imported for use as follows
-```rust,ignore
- use dojo_chess::utils::{is_out_of_board, is_right_piece_move, is_piece_is_mine};
-```
-That's right! you have successfully modularized your functions.
diff --git a/0.3.0/src/tutorial/onchain-chess/README.md b/0.3.0/src/tutorial/onchain-chess/README.md
deleted file mode 100644
index 6e5921e6..00000000
--- a/0.3.0/src/tutorial/onchain-chess/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Building a Chess Game
-
-_"I just finished reading The Dojo Book. What should I do next?"_
-
-The answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction.
-
-This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation.
-
-If you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project.
-
-## What are we building?
-
-We're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows:
-
-1. A system contract to spawn all the chess pieces
-2. A system contract to make pieces move
-3. Add some functions to check a legal move
-4. Play chess ββ - integration test!
-
-The full code of tutorial is based on [this repo](https://github.com/dojoengine/dojo-examples/tree/main/examples/dojo-chess).
-
-If this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple.
-
-## What after this guide?
-
-We're making another guide to help design the frontend. This will make our chess game complete.
-
-After you finish all the four chapters, we can move on to the frontend guide.
diff --git a/0.3.0/po/es.po b/po/es.po
similarity index 100%
rename from 0.3.0/po/es.po
rename to po/es.po
diff --git a/0.3.0/po/messages.pot b/po/messages.pot
similarity index 100%
rename from 0.3.0/po/messages.pot
rename to po/messages.pot