Skip to content

Commit 0fcee35

Browse files
committed
Add send_game_result() documentation
Also, correct formatting and spelling.
1 parent 0dae9d7 commit 0fcee35

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

chess/engine.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,9 @@ async def send_game_result(self, board: chess.Board, winner: Optional[Color] = N
12801280
Sends the engine the result of the game.
12811281
12821282
XBoard engines receive the final moves and a line of the form
1283-
"result <winner> {<ending>}". The <winner> field is one of "1-0",
1284-
"0-1", "1/2-1/2", or "*" to indicate white won, black won, draw,
1285-
or adjournment, respectively. The <ending> field is a description
1283+
``result <winner> {<ending>}``. The ``<winner>`` field is one of ``1-0``,
1284+
``0-1``, ``1/2-1/2``, or ``*`` to indicate white won, black won, draw,
1285+
or adjournment, respectively. The ``<ending>`` field is a description
12861286
of the specific reason for the end of the game: "White mates",
12871287
"Time forfeiture", "Stalemate", etc.
12881288
@@ -1292,9 +1292,10 @@ async def send_game_result(self, board: chess.Board, winner: Optional[Color] = N
12921292
:param board: The final state of the board.
12931293
:param winner: Optional. Specify the winner of the game. This is useful
12941294
if the result of the game is not evident from the board--e.g., time
1295-
forfeiture or draw by agreement.
1295+
forfeiture or draw by agreement. If not ``None``, this parameter
1296+
overrides any winner derivable from the board.
12961297
:param game_ending: Optional. Text describing the reason for the game
1297-
ending. Similarly to the winner paramter, this overrides any game
1298+
ending. Similarly to the winner parameter, this overrides any game
12981299
result derivable from the board.
12991300
:param game_complete: Optional. Whether the game reached completion.
13001301
"""

docs/engine.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ Example: Let Stockfish play against itself, 100 milliseconds per move.
7676
.. autoclass:: chess.engine.Opponent
7777
:members:
7878

79+
.. autoclass:: chess.engine.Protocol
80+
:members: send_game_result
81+
7982
Analysing and evaluating a position
8083
-----------------------------------
8184

0 commit comments

Comments
 (0)