From 6a8b3b7b28e05ecaf69ab996b49201886f4b1380 Mon Sep 17 00:00:00 2001 From: programarivm Date: Wed, 22 May 2024 18:39:25 +0200 Subject: [PATCH] Updated the docs --- docs/accept.md | 6 +++--- docs/heuristics.md | 2 ++ docs/legal.md | 14 +++++--------- docs/online-games.md | 36 ++++++++++++------------------------ docs/play-lan.md | 5 ++++- docs/restart.md | 6 +++--- docs/start.md | 13 +++++++------ docs/stockfish-eval.md | 27 --------------------------- docs/stockfish.md | 8 +++++--- mkdocs.yml | 1 - 10 files changed, 41 insertions(+), 77 deletions(-) delete mode 100644 docs/stockfish-eval.md diff --git a/docs/accept.md b/docs/accept.md index 1358fdd1..8deed851 100644 --- a/docs/accept.md +++ b/docs/accept.md @@ -17,13 +17,13 @@ ws.send('/accept e69e3228e22dbcab5c2274646ae9a23647b222d084e26dea3216016d026f710 ```text { "/accept": { - "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwY2hlc3MubmV0IiwiaWF0IjoxNjk0NDQxOTcxLCJleHAiOjE2OTQ0NDU1NzEsInZhcmlhbnQiOiJjbGFzc2ljYWwiLCJzdWJtb2RlIjoiZnJpZW5kIiwiY29sb3IiOiJ3IiwibWluIjo1LCJpbmNyZW1lbnQiOjMsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.POuK_cR3U_bblLa8LFyGg1AJEE5_iW_AquuNn7K4qHI", - "hash": "e69e3228e22dbcab5c2274646ae9a23647b222d084e26dea3216016d026f7108", + "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTYzOTMxOTQsImV4cCI6MTcxNjM5Njc5NCwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJvbmxpbmUiLCJjb2xvciI6ImIiLCJtaW4iOjUsImluY3JlbWVudCI6MywiZmVuIjoicm5icWtibnIvcHBwcHBwcHAvOC84LzgvOC9QUFBQUFBQUC9STkJRS0JOUiB3IEtRa3EgLSJ9.uEVe0vMgOroQCKqTtXqvFZvTidHlESeaVqQXj7_FcdA", + "hash": "74cf7843", "timer": { "w": 300, "b": 300 }, - "startedAt": 1694441992 + "startedAt": 1716393248 } } ``` diff --git a/docs/heuristics.md b/docs/heuristics.md index 6a3ec74c..0aef8e99 100644 --- a/docs/heuristics.md +++ b/docs/heuristics.md @@ -29,6 +29,7 @@ ws.send('/heuristics "rnbqkb1r/p1pp1ppp/1p2pn2/8/2PP4/2N2N2/PP2PPPP/R1BQKB1R b K "Protection", "Threat", "Attack", + "Discovered check", "Doubled pawn", "Passed pawn", "Advanced pawn", @@ -77,6 +78,7 @@ ws.send('/heuristics "rnbqkb1r/p1pp1ppp/1p2pn2/8/2PP4/2N2N2/PP2PPPP/R1BQKB1R b K 0, 0, 0, + 0, 0 ] } diff --git a/docs/legal.md b/docs/legal.md index 16dfe1de..f46d2022 100644 --- a/docs/legal.md +++ b/docs/legal.md @@ -1,6 +1,6 @@ # /legal -Returns the legal FEN positions of a piece. +Returns the legal moves of a piece. | Name | Description | Required | | ---- | ----------- | -------- | @@ -19,13 +19,9 @@ ws.send('/legal e2'); ```text { - "/legal": { - "color": "w", - "id": "P", - "fen": { - "e3": "rnbqkbnr/pppppppp/8/8/8/4P3/PPPP1PPP/RNBQKBNR b KQkq -", - "e4": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3" - } - } + "/legal": [ + "e3", + "e4" + ] } ``` diff --git a/docs/online-games.md b/docs/online-games.md index 38807abb..a5e446c8 100644 --- a/docs/online-games.md +++ b/docs/online-games.md @@ -15,40 +15,28 @@ ws.send('/online_games'); "/online_games": [ { "iss": "async.chesslablab.org", - "iat": 1704983331, - "exp": 1704986931, + "iat": 1716395884, + "exp": 1716399484, "variant": "classical", "submode": "online", "color": "b", - "min": 5, - "increment": 1, + "min": "17", + "increment": "8", "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -", - "hash": "d1a4f2f3688e3211e94fe643a679204806cd196303e44522e833815e4f728c65" + "hash": "ec82790d" }, { "iss": "async.chesslablab.org", - "iat": 1704983347, - "exp": 1704986947, + "iat": 1716395890, + "exp": 1716399490, "variant": "960", "submode": "online", "color": "w", - "min": 10, - "increment": 5, - "fen": "bqrnnbkr/pppppppp/8/8/8/8/PPPPPPPP/BQRNNBKR w KQkq -", - "startPos": "BQRNNBKR", - "hash": "e71a27a35d021acfe9ad819348ec2c574f1962aa14fddc58df379d0b3c225cc8" - }, - { - "iss": "async.chesslablab.org", - "iat": 1704983367, - "exp": 1704986967, - "variant": "capablanca", - "submode": "online", - "color": "b", - "min": 30, - "increment": 10, - "fen": "rnabqkbcnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNABQKBCNR w KQkq -", - "hash": "2e2c447c902a34f55145769fe9454cf055a6b3e7658756ade2b2ac783d24c568" + "min": "5", + "increment": "3", + "fen": "brnnkbrq/pppppppp/8/8/8/8/PPPPPPPP/BRNNKBRQ w KQkq -", + "startPos": "BRNNKBRQ", + "hash": "c0597f26" } ] } diff --git a/docs/play-lan.md b/docs/play-lan.md index 1aa612b5..1aed987a 100644 --- a/docs/play-lan.md +++ b/docs/play-lan.md @@ -31,8 +31,11 @@ ws.send('/play_lan w e2e4'); "isMate": false, "isStalemate": false, "isFivefoldRepetition": false, + "isFiftyMoveDraw": false, + "isDeadPositionDraw": false, "mode": "fen", - "variant": "classical" + "variant": "classical", + "isValid": true } } ``` diff --git a/docs/restart.md b/docs/restart.md index fbe1bf97..5ded1837 100644 --- a/docs/restart.md +++ b/docs/restart.md @@ -11,14 +11,14 @@ Restarts an existing game. ### Example ```js -ws.send('/restart ffc536a8f44fc21b4d254e4fb85d7e33'); +ws.send('/restart cf897a92'); ``` ```text { "/restart": { - "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwY2hlc3MubmV0IiwiaWF0IjoxNjk0MTAxOTI2LCJleHAiOjE2OTQxMDU1MjYsInZhcmlhbnQiOiJjbGFzc2ljYWwiLCJzdWJtb2RlIjoib25saW5lIiwiY29sb3IiOiJ3IiwibWluIjo1LCJpbmNyZW1lbnQiOjMsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.sE6Is9GYf0R6l0_C8rt7VPE8fVChsYlb9teEQw_2QUQ", - "hash": "5665d2e6c84344db95aa9fdbb3bc196b88238bce22a1c58a41f2f269deee6c33", + "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTYzOTMzOTksImV4cCI6MTcxNjM5Njk5OSwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJvbmxpbmUiLCJjb2xvciI6InciLCJtaW4iOiI1IiwiaW5jcmVtZW50IjoiMyIsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.-i3o-ODk7HF_ifuwiXLzpP5Itw12QTB07XeqbEQdULM", + "hash": "72647a10", "timer": { "w": 300, "b": 300 diff --git a/docs/start.md b/docs/start.md index 0a324ec2..f0e1db04 100644 --- a/docs/start.md +++ b/docs/start.md @@ -108,7 +108,7 @@ ws.send('/start 960 san "{\\"movetext\\":\\"1.e4 Nc6 2.d4\\",\\"startPos\\":\\"B | `add` | `color` | Yes | ```js -ws.send('/start classical stockfish b'); +ws.send('/start classical stockfish {"color":"b"}'); ``` ```text @@ -116,7 +116,8 @@ ws.send('/start classical stockfish b'); "/start": { "variant": "classical", "mode": "stockfish", - "color": "b" + "color": "b", + "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -" } } ``` @@ -133,8 +134,8 @@ ws.send('/start classical play {"min":5,"increment":3,"color":"b","submode":"onl "variant": "classical", "mode": "play", "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -", - "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTA1MjM2MzUsImV4cCI6MTcxMDUyNzIzNSwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJvbmxpbmUiLCJjb2xvciI6InciLCJtaW4iOiI1IiwiaW5jcmVtZW50IjoiMyIsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.gGEgw7zZmJk3ftnS9Yu-RcvhFBzc9eKbvF_45hrEt4E", - "hash": "db4a87907dfaaede54c56b3edddbe7e3a8c01803f8906be7bb7a2e180353ce58" + "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTYzOTE1MTMsImV4cCI6MTcxNjM5NTExMywidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJvbmxpbmUiLCJjb2xvciI6ImIiLCJtaW4iOjUsImluY3JlbWVudCI6MywiZmVuIjoicm5icWtibnIvcHBwcHBwcHAvOC84LzgvOC9QUFBQUFBQUC9STkJRS0JOUiB3IEtRa3EgLSJ9.BBJROgd2AP9_65QM3UIuxHk9HJ7ySwb_Y7HlVFFxnQE", + "hash": "2a2c768c" } } ``` @@ -155,8 +156,8 @@ ws.send('/start classical play "{\\"min\\":5,\\"increment\\":3,\\"color\\":\\"w\ "variant": "classical", "mode": "play", "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -", - "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTA1MjM5MzUsImV4cCI6MTcxMDUyNzUzNSwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJmcmllbmQiLCJjb2xvciI6ImIiLCJtaW4iOiI1IiwiaW5jcmVtZW50IjoiMyIsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.Tl_loA70IUidZ9XG9Pw9osC9MZIHbxjg_eDMkGS6des", - "hash": "7eb1642c7d5faf2dee2e5dd5aef871c55fe29b5791c8e67746664e8f2517727c" + "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhc3luYy5jaGVzc2xhYmxhYi5vcmciLCJpYXQiOjE3MTYzOTE1NTAsImV4cCI6MTcxNjM5NTE1MCwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJmcmllbmQiLCJjb2xvciI6InciLCJtaW4iOjUsImluY3JlbWVudCI6MywiZmVuIjoicm5icWtibnIvcHBwcHBwcHAvOC84LzgvOC9QUFBQUFBQUC9STkJRS0JOUiB3IEtRa3EgLSJ9.t40rbfZJb8JF8QpVMx9v96yQXzw54gLALMnKRS6qFdE", + "hash": "c13d765b" } } ``` diff --git a/docs/stockfish-eval.md b/docs/stockfish-eval.md deleted file mode 100644 index 8c090323..00000000 --- a/docs/stockfish-eval.md +++ /dev/null @@ -1,27 +0,0 @@ -# /stockfish_eval - -Returns Stockfish's evaluation for the given position. - -| Name | Description | Required | -| ---- | ----------- | -------- | -| `fen` | A FEN string. | Yes | - -## Usage - -### Example - -Evaluate C65 — Ruy Lopez: Berlin Defense. - -```js -ws.send('/stockfish_eval "r1bqkb1r/pppp1ppp/2n2n2/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4"'); -``` - -```text -{ - "/stockfish_eval": { - "nag": "$10", - "meaning": "Equal position", - "symbol": "=" - } -} -``` diff --git a/docs/stockfish.md b/docs/stockfish.md index 6df8c314..a6d5ca26 100644 --- a/docs/stockfish.md +++ b/docs/stockfish.md @@ -23,15 +23,17 @@ ws.send('/stockfish "{\\"Skill Level\\":20}" "{\\"depth\\":12}"'); { "/stockfish": { "turn": "w", - "pgn": "c5", + "pgn": "e5", "castlingAbility": "KQkq", - "movetext": "1.e4 c5", - "fen": "rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6", + "movetext": "1.e4 e5", + "fen": "rnbqkbnr/pppp1ppp/8/4p3/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e6", "isCapture": false, "isCheck": false, "isMate": false, "isStalemate": false, "isFivefoldRepetition": false, + "isFiftyMoveDraw": false, + "isDeadPositionDraw": false, "mode": "stockfish", "variant": "classical" } diff --git a/mkdocs.yml b/mkdocs.yml index bd914356..9976c660 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,5 @@ nav: - /rematch: rematch.md - /restart: restart.md - /stockfish: stockfish.md - - /stockfish_eval: stockfish-eval.md - /online_games: online-games.md theme: readthedocs