Skip to content

Commit

Permalink
Fix formatting for example code in chess docstring (doctest) (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottower authored Jul 7, 2023
1 parent 2926e8a commit 7714f51
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pettingzoo/classic/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@
You can get back the original (x,y,c) coordinates from the integer action `a` with the following expression: `(a // (8*73), (a // 73) % 8, a % (8*73) % 73)`
> x = 6
> y = 0
> c = 12
> a = x*(8*73) + y*73 + c
> print(a // (8*73), a % (8*73) // 73, a % (8*73) % 73) # -> 6 0 12
Example:
>>> x = 6
>>> y = 0
>>> c = 12
>>> a = x*(8*73) + y*73 + c
>>> print(a // (8*73), a % (8*73) // 73, a % (8*73) % 73)
6 0 12
Note: the coordinates (6, 0, 12) correspond to column 6, row 0, plane 12. In chess notation, this would signify square G1:
Expand Down

0 comments on commit 7714f51

Please sign in to comment.