Chess player/PicoLisp: Difference between revisions
no edit summary
m (→{{header|PicoLisp}}: "header" template isn't necessary on this page) |
No edit summary |
||
Line 1:
This implementation supports all chess rules (including castling, pawn promotion and en passant), switching sides, unlimited undo/redo, and the setup, saving and loading of board positions to/from files.
<
# *White *Black *WKPos *BKPos *Pinned
# *Depth *Moved *Undo *Redo *Me *You
Line 566:
(val This)
(not (memq This *Moved)) ) )
(append *White *Black) ) ) ) ) ) )
</syntaxhighlight>
Start:
<pre>
+---+---+---+---+---+---+---+---+
8 |<R>|<N>|<B>|<Q>|<K>|<B>|<N>|<R>|
Line 586 ⟶ 588:
1 | R | N | B | Q | K | B | N | R |
+---+---+---+---+---+---+---+---+
a b c d e f g h
</pre>
Entering moves:
<syntaxhighlight lang
Undo moves:
<syntaxhighlight lang
Redo:
<syntaxhighlight lang
Switch sides:
<syntaxhighlight lang
Save position to a file:
<
Load position from file:
<
|