chess 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +7 -12
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/docs/Chess/BadNotationError.html +3 -3
- data/docs/Chess/Board.html +180 -43
- data/docs/Chess/CGame.html +33 -33
- data/docs/Chess/Game.html +44 -44
- data/docs/Chess/Gnuchess.html +3 -3
- data/docs/Chess/IllegalMoveError.html +5 -5
- data/docs/Chess/InvalidFenFormatError.html +3 -3
- data/docs/Chess/InvalidPgnFormatError.html +3 -3
- data/docs/Chess/Pgn.html +8 -8
- data/docs/Chess/UTF8Notation.html +7 -7
- data/docs/Chess.html +5 -5
- data/docs/_index.html +3 -3
- data/docs/file.README.html +5 -5
- data/docs/frames.html +9 -4
- data/docs/index.html +5 -5
- data/docs/method_list.html +61 -53
- data/docs/top-level-namespace.html +3 -3
- data/ext/chess/chess.c +33 -0
- data/ext/chess/chess.h +1 -0
- data/ext/chess/extconf.rb +1 -26
- data/ext/chess/special.c +6 -6
- data/lib/chess/version.rb +1 -1
- data/test/test_move_generator.rb +15 -0
- metadata +2 -2
data/docs/Chess/CGame.html
CHANGED
@@ -94,8 +94,8 @@
|
|
94
94
|
|
95
95
|
<dl>
|
96
96
|
<dt>Defined in:</dt>
|
97
|
-
<dd>ext/chess.c<span class="defines">,<br />
|
98
|
-
ext/chess.c</span>
|
97
|
+
<dd>ext/chess/chess.c<span class="defines">,<br />
|
98
|
+
ext/chess/chess.c</span>
|
99
99
|
</dd>
|
100
100
|
</dl>
|
101
101
|
|
@@ -389,7 +389,7 @@
|
|
389
389
|
|
390
390
|
|
391
391
|
<span class="summary_desc"><div class='inline'>
|
392
|
-
<p>The game result is set to
|
392
|
+
<p>The game result is set to ‘1-0’ if <code>color</code> is <em>black</em>, otherwise is set to ‘0-1’ if color is <em>white</em>.</p>
|
393
393
|
</div></span>
|
394
394
|
|
395
395
|
</li>
|
@@ -611,7 +611,7 @@
|
|
611
611
|
220</pre>
|
612
612
|
</td>
|
613
613
|
<td>
|
614
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 210</span>
|
614
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 210</span>
|
615
615
|
|
616
616
|
VALUE
|
617
617
|
game_boards (VALUE self, VALUE index)
|
@@ -691,7 +691,7 @@ game_boards (VALUE self, VALUE index)
|
|
691
691
|
267</pre>
|
692
692
|
</td>
|
693
693
|
<td>
|
694
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 258</span>
|
694
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 258</span>
|
695
695
|
|
696
696
|
VALUE
|
697
697
|
game_coord_moves (VALUE self)
|
@@ -771,7 +771,7 @@ game_coord_moves (VALUE self)
|
|
771
771
|
234</pre>
|
772
772
|
</td>
|
773
773
|
<td>
|
774
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 228</span>
|
774
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 228</span>
|
775
775
|
|
776
776
|
VALUE
|
777
777
|
game_current_board (VALUE self)
|
@@ -845,7 +845,7 @@ game_current_board (VALUE self)
|
|
845
845
|
202</pre>
|
846
846
|
</td>
|
847
847
|
<td>
|
848
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 195</span>
|
848
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 195</span>
|
849
849
|
|
850
850
|
VALUE
|
851
851
|
game_draw (VALUE self)
|
@@ -964,7 +964,7 @@ game_draw (VALUE self)
|
|
964
964
|
353</pre>
|
965
965
|
</td>
|
966
966
|
<td>
|
967
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 339</span>
|
967
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 339</span>
|
968
968
|
|
969
969
|
VALUE
|
970
970
|
game_each (VALUE self)
|
@@ -1032,7 +1032,7 @@ game_each (VALUE self)
|
|
1032
1032
|
278</pre>
|
1033
1033
|
</td>
|
1034
1034
|
<td>
|
1035
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 273</span>
|
1035
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 273</span>
|
1036
1036
|
|
1037
1037
|
VALUE
|
1038
1038
|
game_full_moves (VALUE self)
|
@@ -1093,7 +1093,7 @@ game_full_moves (VALUE self)
|
|
1093
1093
|
|
1094
1094
|
—
|
1095
1095
|
<div class='inline'>
|
1096
|
-
<p>The character of the moving piece <em>(
|
1096
|
+
<p>The character of the moving piece <em>(‘P’, ‘R’, ‘N’, ‘B’, ‘Q’, ‘K’)</em>.</p>
|
1097
1097
|
</div>
|
1098
1098
|
|
1099
1099
|
</li>
|
@@ -1109,13 +1109,13 @@ game_full_moves (VALUE self)
|
|
1109
1109
|
|
1110
1110
|
—
|
1111
1111
|
<div class='inline'>
|
1112
|
-
<p>When two (or more) identical pieces can move to the same square, the moving piece is uniquely identified by specifying the piece
|
1112
|
+
<p>When two (or more) identical pieces can move to the same square, the moving piece is uniquely identified by specifying the piece’s letter, followed by (in descending order of preference):</p>
|
1113
1113
|
<ul><li>
|
1114
1114
|
<p>the file of departure (if they differ);</p>
|
1115
1115
|
</li><li>
|
1116
1116
|
<p>the rank of departure (if the files are the same but the ranks differ);</p>
|
1117
1117
|
</li><li>
|
1118
|
-
<p>both the rank and file (if neither alone is sufficient to identify the
|
1118
|
+
<p>both the rank and file (if neither alone is sufficient to identify the piece—which occurs only in rare cases where one or more pawns have promoted, resulting in a player having three or more identical pieces able to reach the same square). Keep <code>nil</code> if no needed.</p>
|
1119
1119
|
</li></ul>
|
1120
1120
|
</div>
|
1121
1121
|
|
@@ -1132,7 +1132,7 @@ game_full_moves (VALUE self)
|
|
1132
1132
|
|
1133
1133
|
—
|
1134
1134
|
<div class='inline'>
|
1135
|
-
<p>The square where the moving piece will <em>(
|
1135
|
+
<p>The square where the moving piece will <em>(‘a1’, ‘a2’, … , ‘h7’, ‘h8’)</em>.</p>
|
1136
1136
|
</div>
|
1137
1137
|
|
1138
1138
|
</li>
|
@@ -1148,7 +1148,7 @@ game_full_moves (VALUE self)
|
|
1148
1148
|
|
1149
1149
|
—
|
1150
1150
|
<div class='inline'>
|
1151
|
-
<p>The character of promotion piece <em>(
|
1151
|
+
<p>The character of promotion piece <em>(‘R’, ‘N’, ‘B’, ‘Q’)</em>. If not <code>nil</code> and no promotion occured raise an <span class='object_link'><a href="IllegalMoveError.html" title="Chess::IllegalMoveError (class)">IllegalMoveError</a></span>. If <code>nil</code>, <em>‘Q’</em> is the default.</p>
|
1152
1152
|
</div>
|
1153
1153
|
|
1154
1154
|
</li>
|
@@ -1217,7 +1217,7 @@ game_full_moves (VALUE self)
|
|
1217
1217
|
89</pre>
|
1218
1218
|
</td>
|
1219
1219
|
<td>
|
1220
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 71</span>
|
1220
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 71</span>
|
1221
1221
|
|
1222
1222
|
VALUE
|
1223
1223
|
game_move (VALUE self, VALUE rb_piece, VALUE rb_disambiguating, VALUE rb_to_coord, VALUE rb_promote_in)
|
@@ -1291,7 +1291,7 @@ game_move (VALUE self, VALUE rb_piece, VALUE rb_disambiguating, VALUE rb_to_coor
|
|
1291
1291
|
|
1292
1292
|
—
|
1293
1293
|
<div class='inline'>
|
1294
|
-
<p>The 2 character string representing the starting square of the moving piece <em>(
|
1294
|
+
<p>The 2 character string representing the starting square of the moving piece <em>(‘a1’, ‘a2’, … , ‘h7’, ‘h8’)</em>.</p>
|
1295
1295
|
</div>
|
1296
1296
|
|
1297
1297
|
</li>
|
@@ -1307,7 +1307,7 @@ game_move (VALUE self, VALUE rb_piece, VALUE rb_disambiguating, VALUE rb_to_coor
|
|
1307
1307
|
|
1308
1308
|
—
|
1309
1309
|
<div class='inline'>
|
1310
|
-
<p>The 2 character string representing the ending square of the moving piece <em>(
|
1310
|
+
<p>The 2 character string representing the ending square of the moving piece <em>(‘a1’, ‘a2’, … , ‘h7’, ‘h8’)</em>.</p>
|
1311
1311
|
</div>
|
1312
1312
|
|
1313
1313
|
</li>
|
@@ -1323,7 +1323,7 @@ game_move (VALUE self, VALUE rb_piece, VALUE rb_disambiguating, VALUE rb_to_coor
|
|
1323
1323
|
|
1324
1324
|
—
|
1325
1325
|
<div class='inline'>
|
1326
|
-
<p>The character of promotion piece <em>(
|
1326
|
+
<p>The character of promotion piece <em>(‘R’, ‘N’, ‘B’, ‘Q’)</em>. If not <code>nil</code> and no promotion occured raise an <span class='object_link'><a href="IllegalMoveError.html" title="Chess::IllegalMoveError (class)">IllegalMoveError</a></span>. If <code>nil</code>, <em>‘Q’</em> is the default.</p>
|
1327
1327
|
</div>
|
1328
1328
|
|
1329
1329
|
</li>
|
@@ -1387,7 +1387,7 @@ game_move (VALUE self, VALUE rb_piece, VALUE rb_disambiguating, VALUE rb_to_coor
|
|
1387
1387
|
119</pre>
|
1388
1388
|
</td>
|
1389
1389
|
<td>
|
1390
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 106</span>
|
1390
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 106</span>
|
1391
1391
|
|
1392
1392
|
VALUE
|
1393
1393
|
game_move2 (VALUE self, VALUE rb_from, VALUE rb_to, VALUE rb_promote_in)
|
@@ -1500,7 +1500,7 @@ game_move2 (VALUE self, VALUE rb_from, VALUE rb_to, VALUE rb_promote_in)
|
|
1500
1500
|
|
1501
1501
|
—
|
1502
1502
|
<div class='inline'>
|
1503
|
-
<p>The character of promotion piece <em>(
|
1503
|
+
<p>The character of promotion piece <em>(‘R’, ‘N’, ‘B’, ‘Q’)</em>. If not <code>nil</code> and no promotion occured raise an <span class='object_link'><a href="IllegalMoveError.html" title="Chess::IllegalMoveError (class)">IllegalMoveError</a></span>. If <code>nil</code>, <em>‘Q’</em> is the default.</p>
|
1504
1504
|
</div>
|
1505
1505
|
|
1506
1506
|
</li>
|
@@ -1564,7 +1564,7 @@ game_move2 (VALUE self, VALUE rb_from, VALUE rb_to, VALUE rb_promote_in)
|
|
1564
1564
|
163</pre>
|
1565
1565
|
</td>
|
1566
1566
|
<td>
|
1567
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 150</span>
|
1567
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 150</span>
|
1568
1568
|
|
1569
1569
|
VALUE
|
1570
1570
|
game_move3 (VALUE self, VALUE rb_from, VALUE rb_to, VALUE rb_promote_in)
|
@@ -1647,7 +1647,7 @@ game_move3 (VALUE self, VALUE rb_from, VALUE rb_to, VALUE rb_promote_in)
|
|
1647
1647
|
250</pre>
|
1648
1648
|
</td>
|
1649
1649
|
<td>
|
1650
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 241</span>
|
1650
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 241</span>
|
1651
1651
|
|
1652
1652
|
VALUE
|
1653
1653
|
game_moves (VALUE self)
|
@@ -1684,7 +1684,7 @@ game_moves (VALUE self)
|
|
1684
1684
|
<div class="docstring">
|
1685
1685
|
<div class="discussion">
|
1686
1686
|
|
1687
|
-
<p>The game result is set to
|
1687
|
+
<p>The game result is set to ‘1-0’ if <code>color</code> is <em>black</em>, otherwise is set to ‘0-1’ if color is <em>white</em>.</p>
|
1688
1688
|
|
1689
1689
|
|
1690
1690
|
</div>
|
@@ -1752,7 +1752,7 @@ game_moves (VALUE self)
|
|
1752
1752
|
188</pre>
|
1753
1753
|
</td>
|
1754
1754
|
<td>
|
1755
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 173</span>
|
1755
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 173</span>
|
1756
1756
|
|
1757
1757
|
VALUE
|
1758
1758
|
game_resign (VALUE self, VALUE color)
|
@@ -1851,7 +1851,7 @@ game_resign (VALUE self, VALUE color)
|
|
1851
1851
|
315</pre>
|
1852
1852
|
</td>
|
1853
1853
|
<td>
|
1854
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 306</span>
|
1854
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 306</span>
|
1855
1855
|
|
1856
1856
|
VALUE
|
1857
1857
|
game_result (VALUE self)
|
@@ -1933,7 +1933,7 @@ game_result (VALUE self)
|
|
1933
1933
|
367</pre>
|
1934
1934
|
</td>
|
1935
1935
|
<td>
|
1936
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 360</span>
|
1936
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 360</span>
|
1937
1937
|
|
1938
1938
|
VALUE
|
1939
1939
|
game_rollback (VALUE self)
|
@@ -2033,7 +2033,7 @@ game_rollback (VALUE self)
|
|
2033
2033
|
43</pre>
|
2034
2034
|
</td>
|
2035
2035
|
<td>
|
2036
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 36</span>
|
2036
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 36</span>
|
2037
2037
|
|
2038
2038
|
VALUE
|
2039
2039
|
game_set_fen (VALUE self, VALUE fen)
|
@@ -2107,7 +2107,7 @@ game_set_fen (VALUE self, VALUE fen)
|
|
2107
2107
|
328</pre>
|
2108
2108
|
</td>
|
2109
2109
|
<td>
|
2110
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 322</span>
|
2110
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 322</span>
|
2111
2111
|
|
2112
2112
|
VALUE
|
2113
2113
|
game_size (VALUE self)
|
@@ -2183,7 +2183,7 @@ game_size (VALUE self)
|
|
2183
2183
|
294</pre>
|
2184
2184
|
</td>
|
2185
2185
|
<td>
|
2186
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 285</span>
|
2186
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 285</span>
|
2187
2187
|
|
2188
2188
|
VALUE
|
2189
2189
|
game_threefold_repetition (VALUE self)
|
@@ -2263,7 +2263,7 @@ game_threefold_repetition (VALUE self)
|
|
2263
2263
|
384</pre>
|
2264
2264
|
</td>
|
2265
2265
|
<td>
|
2266
|
-
<pre class="code"><span class="info file"># File 'ext/chess.c', line 374</span>
|
2266
|
+
<pre class="code"><span class="info file"># File 'ext/chess/chess.c', line 374</span>
|
2267
2267
|
|
2268
2268
|
VALUE
|
2269
2269
|
game_to_s (VALUE self)
|
@@ -2286,9 +2286,9 @@ game_to_s (VALUE self)
|
|
2286
2286
|
</div>
|
2287
2287
|
|
2288
2288
|
<div id="footer">
|
2289
|
-
Generated on
|
2290
|
-
<a href="
|
2291
|
-
0.9.
|
2289
|
+
Generated on Fri Aug 30 11:09:51 2024 by
|
2290
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2291
|
+
0.9.36 (ruby-3.3.2).
|
2292
2292
|
</div>
|
2293
2293
|
|
2294
2294
|
</div>
|
data/docs/Chess/Game.html
CHANGED
@@ -467,13 +467,13 @@
|
|
467
467
|
<pre class="lines">
|
468
468
|
|
469
469
|
|
470
|
+
7
|
471
|
+
8
|
470
472
|
9
|
471
|
-
10
|
472
|
-
11
|
473
|
-
12</pre>
|
473
|
+
10</pre>
|
474
474
|
</td>
|
475
475
|
<td>
|
476
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
476
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 7</span>
|
477
477
|
|
478
478
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
479
479
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
@@ -571,16 +571,16 @@
|
|
571
571
|
<pre class="lines">
|
572
572
|
|
573
573
|
|
574
|
+
40
|
575
|
+
41
|
574
576
|
42
|
575
577
|
43
|
576
578
|
44
|
577
579
|
45
|
578
|
-
46
|
579
|
-
47
|
580
|
-
48</pre>
|
580
|
+
46</pre>
|
581
581
|
</td>
|
582
582
|
<td>
|
583
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
583
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 40</span>
|
584
584
|
|
585
585
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_fen'>load_fen</span><span class='lparen'>(</span><span class='id identifier rubyid_fen'>fen</span><span class='rparen'>)</span>
|
586
586
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="InvalidFenFormatError.html" title="Chess::InvalidFenFormatError (class)">InvalidFenFormatError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="InvalidFenFormatError.html#initialize-instance_method" title="Chess::InvalidFenFormatError#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_fen'>fen</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^((?:[PRNBQKprnbqk1-8]{1,8}\/){7}[RNBQKPrnbqkp1-8]{1,8})\s(w|b)\s(K?Q?k?q?|-)\s([a-h][1-8]|-)\s(\d+)\s(\d+)$</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_fen'>fen</span><span class='rparen'>)</span>
|
@@ -684,6 +684,8 @@
|
|
684
684
|
<pre class="lines">
|
685
685
|
|
686
686
|
|
687
|
+
18
|
688
|
+
19
|
687
689
|
20
|
688
690
|
21
|
689
691
|
22
|
@@ -697,12 +699,10 @@
|
|
697
699
|
30
|
698
700
|
31
|
699
701
|
32
|
700
|
-
33
|
701
|
-
34
|
702
|
-
35</pre>
|
702
|
+
33</pre>
|
703
703
|
</td>
|
704
704
|
<td>
|
705
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
705
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 18</span>
|
706
706
|
|
707
707
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_pgn'>load_pgn</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
708
708
|
<span class='id identifier rubyid_pgn'>pgn</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Chess.html" title="Chess (module)">Chess</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pgn.html" title="Chess::Pgn (class)">Pgn</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pgn.html#initialize-instance_method" title="Chess::Pgn#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
@@ -770,12 +770,12 @@
|
|
770
770
|
<pre class="lines">
|
771
771
|
|
772
772
|
|
773
|
-
|
774
|
-
|
775
|
-
|
773
|
+
83
|
774
|
+
84
|
775
|
+
85</pre>
|
776
776
|
</td>
|
777
777
|
<td>
|
778
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
778
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 83</span>
|
779
779
|
|
780
780
|
<span class='kw'>def</span> <span class='id identifier rubyid_active_player'>active_player</span>
|
781
781
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_active_color'>active_color</span> <span class='op'>?</span> <span class='symbol'>:black</span> <span class='op'>:</span> <span class='symbol'>:white</span>
|
@@ -824,12 +824,12 @@
|
|
824
824
|
<pre class="lines">
|
825
825
|
|
826
826
|
|
827
|
-
|
828
|
-
|
829
|
-
|
827
|
+
90
|
828
|
+
91
|
829
|
+
92</pre>
|
830
830
|
</td>
|
831
831
|
<td>
|
832
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
832
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 90</span>
|
833
833
|
|
834
834
|
<span class='kw'>def</span> <span class='id identifier rubyid_inactive_player'>inactive_player</span>
|
835
835
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_active_color'>active_color</span> <span class='op'>?</span> <span class='symbol'>:white</span> <span class='op'>:</span> <span class='symbol'>:black</span>
|
@@ -883,7 +883,7 @@
|
|
883
883
|
|
884
884
|
—
|
885
885
|
<div class='inline'>
|
886
|
-
<p>Represents the short algebraic chess notation string of the move. <code>notation</code> can be also <em>from_square</em> plus <em>to_square</em> <em>(
|
886
|
+
<p>Represents the short algebraic chess notation string of the move. <code>notation</code> can be also <em>from_square</em> plus <em>to_square</em> <em>(‘e2e4’, …, ‘b1c3’)</em> (coordinate chess notation).</p>
|
887
887
|
</div>
|
888
888
|
|
889
889
|
</li>
|
@@ -947,6 +947,8 @@
|
|
947
947
|
<pre class="lines">
|
948
948
|
|
949
949
|
|
950
|
+
59
|
951
|
+
60
|
950
952
|
61
|
951
953
|
62
|
952
954
|
63
|
@@ -956,12 +958,10 @@
|
|
956
958
|
67
|
957
959
|
68
|
958
960
|
69
|
959
|
-
70
|
960
|
-
71
|
961
|
-
72</pre>
|
961
|
+
70</pre>
|
962
962
|
</td>
|
963
963
|
<td>
|
964
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
964
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 59</span>
|
965
965
|
|
966
966
|
<span class='kw'>def</span> <span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='id identifier rubyid_notation'>notation</span><span class='rparen'>)</span>
|
967
967
|
<span class='id identifier rubyid_expand'>expand</span> <span class='op'>=</span> <span class='id identifier rubyid_expand_move'>expand_move</span><span class='lparen'>(</span><span class='id identifier rubyid_notation'>notation</span><span class='rparen'>)</span>
|
@@ -1026,12 +1026,12 @@
|
|
1026
1026
|
<pre class="lines">
|
1027
1027
|
|
1028
1028
|
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1029
|
+
76
|
1030
|
+
77
|
1031
|
+
78</pre>
|
1032
1032
|
</td>
|
1033
1033
|
<td>
|
1034
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
1034
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 76</span>
|
1035
1035
|
|
1036
1036
|
<span class='kw'>def</span> <span class='id identifier rubyid_moves='>moves=</span><span class='lparen'>(</span><span class='id identifier rubyid_moves'>moves</span><span class='rparen'>)</span>
|
1037
1037
|
<span class='id identifier rubyid_moves'>moves</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
@@ -1080,12 +1080,12 @@
|
|
1080
1080
|
<pre class="lines">
|
1081
1081
|
|
1082
1082
|
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1083
|
+
129
|
1084
|
+
130
|
1085
|
+
131</pre>
|
1086
1086
|
</td>
|
1087
1087
|
<td>
|
1088
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
1088
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 129</span>
|
1089
1089
|
|
1090
1090
|
<span class='kw'>def</span> <span class='id identifier rubyid_over?'>over?</span>
|
1091
1091
|
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>*</span><span class='tstring_end'>'</span></span>
|
@@ -1134,15 +1134,15 @@
|
|
1134
1134
|
<pre class="lines">
|
1135
1135
|
|
1136
1136
|
|
1137
|
+
135
|
1138
|
+
136
|
1137
1139
|
137
|
1138
1140
|
138
|
1139
1141
|
139
|
1140
|
-
140
|
1141
|
-
141
|
1142
|
-
142</pre>
|
1142
|
+
140</pre>
|
1143
1143
|
</td>
|
1144
1144
|
<td>
|
1145
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
1145
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 135</span>
|
1146
1146
|
|
1147
1147
|
<span class='kw'>def</span> <span class='id identifier rubyid_pgn'>pgn</span>
|
1148
1148
|
<span class='id identifier rubyid_pgn'>pgn</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Chess.html" title="Chess (module)">Chess</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pgn.html" title="Chess::Pgn (class)">Pgn</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pgn.html#initialize-instance_method" title="Chess::Pgn#initialize (method)">new</a></span></span>
|
@@ -1213,6 +1213,8 @@
|
|
1213
1213
|
<pre class="lines">
|
1214
1214
|
|
1215
1215
|
|
1216
|
+
107
|
1217
|
+
108
|
1216
1218
|
109
|
1217
1219
|
110
|
1218
1220
|
111
|
@@ -1230,12 +1232,10 @@
|
|
1230
1232
|
123
|
1231
1233
|
124
|
1232
1234
|
125
|
1233
|
-
126
|
1234
|
-
127
|
1235
|
-
128</pre>
|
1235
|
+
126</pre>
|
1236
1236
|
</td>
|
1237
1237
|
<td>
|
1238
|
-
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line
|
1238
|
+
<pre class="code"><span class="info file"># File 'lib/chess/game.rb', line 107</span>
|
1239
1239
|
|
1240
1240
|
<span class='kw'>def</span> <span class='id identifier rubyid_status'>status</span>
|
1241
1241
|
<span class='kw'>case</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span>
|
@@ -1267,9 +1267,9 @@
|
|
1267
1267
|
</div>
|
1268
1268
|
|
1269
1269
|
<div id="footer">
|
1270
|
-
Generated on
|
1271
|
-
<a href="
|
1272
|
-
0.9.
|
1270
|
+
Generated on Fri Aug 30 11:09:51 2024 by
|
1271
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1272
|
+
0.9.36 (ruby-3.3.2).
|
1273
1273
|
</div>
|
1274
1274
|
|
1275
1275
|
</div>
|
data/docs/Chess/Gnuchess.html
CHANGED
@@ -356,9 +356,9 @@
|
|
356
356
|
</div>
|
357
357
|
|
358
358
|
<div id="footer">
|
359
|
-
Generated on
|
360
|
-
<a href="
|
361
|
-
0.9.
|
359
|
+
Generated on Fri Aug 30 11:09:50 2024 by
|
360
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
361
|
+
0.9.36 (ruby-3.3.2).
|
362
362
|
</div>
|
363
363
|
|
364
364
|
</div>
|
@@ -96,8 +96,8 @@
|
|
96
96
|
|
97
97
|
<dl>
|
98
98
|
<dt>Defined in:</dt>
|
99
|
-
<dd>ext/chess.c<span class="defines">,<br />
|
100
|
-
ext/chess.c</span>
|
99
|
+
<dd>ext/chess/chess.c<span class="defines">,<br />
|
100
|
+
ext/chess/chess.c</span>
|
101
101
|
</dd>
|
102
102
|
</dl>
|
103
103
|
|
@@ -127,9 +127,9 @@
|
|
127
127
|
</div>
|
128
128
|
|
129
129
|
<div id="footer">
|
130
|
-
Generated on
|
131
|
-
<a href="
|
132
|
-
0.9.
|
130
|
+
Generated on Fri Aug 30 11:09:51 2024 by
|
131
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
132
|
+
0.9.36 (ruby-3.3.2).
|
133
133
|
</div>
|
134
134
|
|
135
135
|
</div>
|
@@ -227,9 +227,9 @@
|
|
227
227
|
</div>
|
228
228
|
|
229
229
|
<div id="footer">
|
230
|
-
Generated on
|
231
|
-
<a href="
|
232
|
-
0.9.
|
230
|
+
Generated on Fri Aug 30 11:09:51 2024 by
|
231
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
232
|
+
0.9.36 (ruby-3.3.2).
|
233
233
|
</div>
|
234
234
|
|
235
235
|
</div>
|
@@ -207,9 +207,9 @@
|
|
207
207
|
</div>
|
208
208
|
|
209
209
|
<div id="footer">
|
210
|
-
Generated on
|
211
|
-
<a href="
|
212
|
-
0.9.
|
210
|
+
Generated on Fri Aug 30 11:09:51 2024 by
|
211
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
212
|
+
0.9.36 (ruby-3.3.2).
|
213
213
|
</div>
|
214
214
|
|
215
215
|
</div>
|