Skip to content

Commit

Permalink
Updated the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Nov 15, 2024
1 parent 8dc3a08 commit b036153
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/play-lan.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /play_lan

Plays a move in long algebraic notation.
Plays a move in Long Algebraic Notation (LAN) format.

## `color`

Expand Down
39 changes: 39 additions & 0 deletions docs/play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# /play

Plays a move in Portable Game Notation (PGN) format.

## `color`

The color as per these options.

- `w` for the white pieces.
- `b` for the black pieces.

## `pgn`

The chess move in PGN format.

---

### Usage

#### Example

Starts a classical game to play 1.e4.

```js
ws.send('/start "{\\"variant\\":\\"classical\\",\\"mode\\":\\"analysis\\"}"');
ws.send('/play "{\\"color\\":\\"w\\",\\"pgn\\":\\"e4\\"}"');
```

```text
{
"/play": {
"turn": "b",
"movetext": "1.e4",
"fen": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3",
"variant": "classical",
"isValid": true
}
}
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ nav:
- /heuristic: heuristic.md
- /leave: leave.md
- /legal: legal.md
- /play: play.md
- /play_lan: play-lan.md
- /play_rav: play-rav.md
- /randomizer: randomizer.md
Expand Down

0 comments on commit b036153

Please sign in to comment.