Jump to content

Chess player: Difference between revisions

(→‎{{header|Python}}: add a simple Python engine using python-chess)
Line 956:
 
==={{libheader|python-chess}}===
A very simple chess engine (based on two-ply search plus mobility) using [https://github.com/niklasf/python-chess python-chess]. The computer plays Black.
 
The default Unicode board may look wonky and misaligned with certain terminal fonts. To use an ASCII board instead (like shown below), replace "print(board.unicode())" with "print(board)".
Line 1,020:
P P P P . P P P
R N B Q K B . R
Your move?</pre>
…</pre>
Here is the PGN of a full game against Stockfish. Like many simple chess engines, it has an unfortunate tendency to rush out with its Queen early in the game, leading to its loss:
<pre>
Line 1,035 ⟶ 1,036:
15.Qxe5 Ne8 16.Qg5+ Kd6 17.O-O-O+ Kc6 18.Qb5# 1-0
</pre>
Opening play could be improved a lot by using book moves, which is easy to do in python-chess with its Polyglot support.
 
=={{header|Wren}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.