> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicblock.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Module #2

> open-source chess implementation

The focus of this course is not on how to build the chess logic, but if you are interested this is a video tutorial made by [@Vicyyn](https://twitter.com/vicyyn) that goes into it. We will be referencing his [open-source chess implementation](https://github.com/vicyyn/sol-chess) in our client.

<iframe width="560" height="315" src="https://www.youtube.com/embed/ujd038IjgpI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

## Features

**Logic overview**

* [board.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/board.rs) - handles the logic for interacting with the board
* [color.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/color.rs) - provides basing functionalities to manage the two armies
* [pieces.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/piece.rs) - basic pieces functionalities
* [castling\_rights](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/castling_right.rs) - castling logic
* [draw\_state.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/draw_state.rs) - drawing logic
* [square.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/square.rs) - ranks and files
* [game\_state.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/models/game_state.rs) - turn and state logic

**State overview**

* [game.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/states/game.rs) - game state, manage owner/id/bump
* [user.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/states/user.rs) - manage current game/elo/# of game played.

**Instruction overview**

* [initialize\_users.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/contexts/initialize_user.rs) - initialize users
* [inizialize\_game.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/contexts/initialize_game.rs) - initialize the game
* [join\_game.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/contexts/join_game.rs) - join game
* [leave\_game.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/contexts/leave_game.rs) - leave game
* [resign.rs](https://github.com/vicyyn/sol-chess/blob/main/programs/sol-chess/src/contexts/resign.rs) - resign
