> For the complete documentation index, see [llms.txt](https://organized-chaos.gitbook.io/organized-chaos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organized-chaos.gitbook.io/organized-chaos-docs/chess/leaderboard.md).

# Leaderboard and demo board

The best players by rating and by puzzle rating, on the board and in the chat; and a demo board beside the table that shows the game to everyone around.

The **trophy** at the bottom right of the board shows the best players beside it: by rating, and by puzzle rating. Below the list stands where you are among them all.

<figure><img src="https://3924607527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkrCqB30nvL5PDNUr89iF%2Fuploads%2FfeIM5SGG3vGcUUTdOVxA%2Fchess-leaderboard.webp?alt=media" alt="The leaderboard beside the board"><figcaption><p>The leaderboard under the trophy.</p></figcaption></figure>

* **By rating**: the players who have played at least `Config.LeaderboardMinGames` rated games, with their wins, draws and losses.
* **By puzzle rating**: the players who have tried at least one puzzle, with how many they solved and failed.
* `/chess_top` lists the best five in the chat.

## Boards in the world

`Config.LeaderboardBoards` puts boards into the world, beside a table or anywhere. How they look is `Config.BoardStyle`, or `style` on one of them:

| Style               | What stands there                                                                                                                                                                                                                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'easel'` (default) | A **demo board on an easel**, in the look of its table. Up close it shows the game at the table as it is played: the pieces, the last move, both players with their ratings, whose move it is, and the result once it is over. Between games, and on an easel that stands by no table, it shows the leaderboard |
| `'panel'`           | The leaderboard alone, on a panel standing in the air, readable from both sides                                                                                                                                                                                                                                 |

![The demo board on its easel beside the table, showing the game being played there](https://3924607527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkrCqB30nvL5PDNUr89iF%2Fuploads%2FGOAM94iGmIUaueGXwucC%2Fchess-demo-board.webp?alt=media)

The game or the leaderboard is drawn for players within 22 metres, on the four nearest easels; from further away an easel shows an empty board. The leaderboard is refreshed every minute while someone is near.

```lua
Config.BoardStyle = 'easel'
Config.LeaderboardBoards = {
    { table = 'c1', side = 1 },                                                         -- beside the first table of Config.Tables
    -- { coords = vector3(195.0, -935.0, 30.69), heading = 144.0, style = 'panel' },   -- or anywhere, in a style of its own
}
```

| Field               | Meaning                                                                            |
| ------------------- | ---------------------------------------------------------------------------------- |
| `table`             | A table's id: `'c1'`, `'c2'` ... for `Config.Tables`, `'p1'` ... for placed tables |
| `side`              | `1` on White's right, `-1` on White's left                                         |
| `coords`, `heading` | A spot of its own: where it stands on the ground, and the way it faces             |
| `style`             | `'easel'` or `'panel'` for this board only (optional)                              |

By default there is one demo board beside the first table. `{}` puts up none.

{% hint style="info" %}
With `Config.Leaderboard = false` there are no panels, but the easels still stand and show the game at their table.
{% endhint %}

## Options

| Option                       | Default       | Meaning                                                                                     |
| ---------------------------- | ------------- | ------------------------------------------------------------------------------------------- |
| `Config.Leaderboard`         | `true`        | The leaderboard, its command, and the panels                                                |
| `Config.LeaderboardMinGames` | `1`           | Rated games a player needs to be on it                                                      |
| `Config.CommandTop`          | `'chess_top'` | The command that lists the best five. `false` for none                                      |
| `Config.BoardStyle`          | `'easel'`     | How the boards in the world look: `'easel'` (the demo board) or `'panel'` (the leaderboard) |

Other resources read it with the export `getLeaderboard`, see [Exports and events](/organized-chaos-docs/chess/exports-and-events.md).
