Skip to content

Commit

Permalink
Updated Internal Board Representation in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hrushikeshrv committed Mar 13, 2023
1 parent 0c1d807 commit 9de0cc6
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 87 deletions.
Binary file modified docs/_build/doctrees/chessboard.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/ref/chessengine.lookup_tables.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b170a29c9d5c6beebdc014c42bee8a07
config: b341c65ed6f15fdd9234bb7a8b9fc3c5
tags: 645f666f9bcd5a90fca523b33c5a78b7
25 changes: 14 additions & 11 deletions docs/_build/html/_sources/chessboard.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,20 @@ Attributes For Chess Board
- A dictionary mapping tuples of the format ``(side, piece)`` to the corresponding bitboard. For example, ``board[("white", "pawns")]`` returns the bitboard corresponding to white pawns.
* - ``Board.moves``
- ``list[tuple]``
- A list of all moves made on the board. Moves are stored as a 6-tuple in the format ``(start, end, captured_side, captured_piece, captured_bitboard, castle_type, score)`` where -
* ``start`` is the :ref:`position <position_representation>` the piece started from
* ``end`` is the position the piece landed on
* ``captured_side`` is the side of the piece captured (if any, else ``None``)
* ``captured_piece`` is the piece captured (if any, else ``None``)
* ``captured_bitboard`` is the bitboard of the captured piece before it was captured (used to restore it when we want to undo moves).
* ``castle_type`` is a string representing the castle type the move was (if it was a castle), else ``None``. ``castle_type`` can take values ``"white_kingside"``, ``"white_queenside"``, ``"black_kingside"``, ``"black_queenside"``.
* ``score`` is the score (current static evaluation) of the board
* - ``Board.piece_count``
- ``dict[tuple[str,str], int]``
- A dictionary mapping tuples of the format (side, piece) to the number of pieces of that side on the board currently. For example, at the start of the game ``piece_count[("white", "pawns")]`` will be 8.
- A list of all moves made on the board. Moves are stored as a tuple containing the fields listed below -

0. ``start`` is the :ref:`position <position_representation>` the piece started from
1. ``end`` is the position the piece landed on
2. ``captured_side`` is the side of the piece captured (if any, else ``None``)
3. ``captured_piece`` is the piece captured (if any, else ``None``)
4. ``captured_bitboard`` is the bitboard of the captured piece before it was captured (used to restore it when we want to undo moves).
5. ``castle_type`` is a string representing the castle type the move was (if it was a castle), else ``None``. ``castle_type`` can take values ``"white_kingside"``, ``"white_queenside"``, ``"black_kingside"``, ``"black_queenside"``.
6. ``score`` is the score (current static evaluation) of the board
7. ``white_king_side_castle`` is a flag indicating whether white could castle king side
8. ``white_queen_side_castle`` is a flag indicating whether white could castle queen side
9. ``black_king_side_castle`` is a flag indicating whether black could castle king side
10. ``black_queen_side_castle`` is a flag indicating whether black could castle queen side

* - ``Board.side``
- ``str``
- The side of the board. Can be ``"black"`` or ``"white"``.
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.3.2',
VERSION: '0.3.3',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="chessengine.bitboard" href="ref/chessengine.bitboard.html" /><link rel="prev" title="Welcome to chessengine’s documentation!" href="index.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 -->
<title>API Reference - chessengine 0.3.2 documentation</title>
<title>API Reference - chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -123,7 +123,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="index.html"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -146,7 +146,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down
32 changes: 16 additions & 16 deletions docs/_build/html/chessboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Usage &amp; Installation" href="usage.html" /><link rel="prev" title="chessengine.pgn.parser" href="ref/chessengine.pgn.parser.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 -->
<title>Internal Board Representation - chessengine 0.3.2 documentation</title>
<title>Internal Board Representation - chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -123,7 +123,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="index.html"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -146,7 +146,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -244,33 +244,33 @@ <h3>Attributes For Chess Board<a class="headerlink" href="#attributes-for-chess-
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Board.moves</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">list[tuple]</span></code></p></td>
<td><dl class="simple">
<dt>A list of all moves made on the board. Moves are stored as a 6-tuple in the format <code class="docutils literal notranslate"><span class="pre">(start,</span> <span class="pre">end,</span> <span class="pre">captured_side,</span> <span class="pre">captured_piece,</span> <span class="pre">captured_bitboard,</span> <span class="pre">castle_type,</span> <span class="pre">score)</span></code> where -</dt><dd><ul class="simple">
<td><p>A list of all moves made on the board. Moves are stored as a tuple containing the fields listed below -</p>
<blockquote>
<div><ol class="arabic simple" start="0">
<li><p><code class="docutils literal notranslate"><span class="pre">start</span></code> is the <a class="reference internal" href="#position-representation"><span class="std std-ref">position</span></a> the piece started from</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end</span></code> is the position the piece landed on</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">captured_side</span></code> is the side of the piece captured (if any, else <code class="docutils literal notranslate"><span class="pre">None</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">captured_piece</span></code> is the piece captured (if any, else <code class="docutils literal notranslate"><span class="pre">None</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">captured_bitboard</span></code> is the bitboard of the captured piece before it was captured (used to restore it when we want to undo moves).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">castle_type</span></code> is a string representing the castle type the move was (if it was a castle), else <code class="docutils literal notranslate"><span class="pre">None</span></code>. <code class="docutils literal notranslate"><span class="pre">castle_type</span></code> can take values <code class="docutils literal notranslate"><span class="pre">&quot;white_kingside&quot;</span></code>, <code class="docutils literal notranslate"><span class="pre">&quot;white_queenside&quot;</span></code>, <code class="docutils literal notranslate"><span class="pre">&quot;black_kingside&quot;</span></code>, <code class="docutils literal notranslate"><span class="pre">&quot;black_queenside&quot;</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">score</span></code> is the score (current static evaluation) of the board</p></li>
</ul>
</dd>
</dl>
<li><p><code class="docutils literal notranslate"><span class="pre">white_king_side_castle</span></code> is a flag indicating whether white could castle king side</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">white_queen_side_castle</span></code> is a flag indicating whether white could castle queen side</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">black_king_side_castle</span></code> is a flag indicating whether black could castle king side</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">black_queen_side_castle</span></code> is a flag indicating whether black could castle queen side</p></li>
</ol>
</div></blockquote>
</td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Board.piece_count</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">dict[tuple[str,str],</span> <span class="pre">int]</span></code></p></td>
<td><p>A dictionary mapping tuples of the format (side, piece) to the number of pieces of that side on the board currently. For example, at the start of the game <code class="docutils literal notranslate"><span class="pre">piece_count[(&quot;white&quot;,</span> <span class="pre">&quot;pawns&quot;)]</span></code> will be 8.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Board.side</span></code></p></td>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Board.side</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p></td>
<td><p>The side of the board. Can be <code class="docutils literal notranslate"><span class="pre">&quot;black&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;white&quot;</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Board.opponent_side</span></code></p></td>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Board.opponent_side</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p></td>
<td><p>The side of the opponent. Can be <code class="docutils literal notranslate"><span class="pre">&quot;black&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;white&quot;</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Board.en_passant_position</span></code></p></td>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Board.en_passant_position</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p></td>
<td><p>The position on the board to which a pawn can move to capture a pawn of the opposite side by en passant. Set to <code class="docutils literal notranslate"><span class="pre">0</span></code> if no en passant move can be made in the current turn.</p></td>
</tr>
Expand Down Expand Up @@ -369,7 +369,7 @@ <h3>Attributes For Black Side<a class="headerlink" href="#attributes-for-black-s
be specified as mentioned here. Moreover, the <code class="docutils literal notranslate"><span class="pre">Board.move</span></code> function also requires this format for
its <code class="docutils literal notranslate"><span class="pre">start</span></code> and <code class="docutils literal notranslate"><span class="pre">end</span></code> arguments.</p>
<p>To help with converting between coordinates on the board, positions, and powers
of 2, you can use the <span class="xref std std-ref">lookup_tables</span> module.</p>
of 2, you can use the <a class="reference internal" href="ref/chessengine.lookup_tables.html#lookup-tables"><span class="std std-ref">chessengine.lookup_tables</span></a> module.</p>
</section>
</section>

Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="prev" title="Playing A Game" href="playing.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 -->
<title>Contributing A Patch - chessengine 0.3.2 documentation</title>
<title>Contributing A Patch - chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -123,7 +123,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="index.html"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -146,7 +146,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="#" /><link rel="search" title="Search" href="search.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 --><title>Index - chessengine 0.3.2 documentation</title>
<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 --><title>Index - chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -121,7 +121,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="index.html"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -144,7 +144,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="API Reference" href="api.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 -->
<title>chessengine 0.3.2 documentation</title>
<title>chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -123,7 +123,7 @@
</label>
</div>
<div class="header-center">
<a href="#"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="#"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -146,7 +146,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="#">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/playing.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Contributing A Patch" href="contributing.html" /><link rel="prev" title="Usage &amp; Installation" href="usage.html" />

<!-- Generated with Sphinx 5.3.0 and Furo 2022.12.07 -->
<title>Playing A Game - chessengine 0.3.2 documentation</title>
<title>Playing A Game - chessengine 0.3.3 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=91d0f0d1c444bdcb17a68e833c7a53903343c195" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
Expand Down Expand Up @@ -123,7 +123,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">chessengine 0.3.2 documentation</div></a>
<a href="index.html"><div class="brand">chessengine 0.3.3 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -146,7 +146,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">


<span class="sidebar-brand-text">chessengine 0.3.2 documentation</span>
<span class="sidebar-brand-text">chessengine 0.3.3 documentation</span>

</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down
Loading

0 comments on commit 9de0cc6

Please sign in to comment.