Chess player: Difference between revisions

Content added Content deleted
Line 958: Line 958:
A very simple chess engine using [https://github.com/niklasf/python-chess python-chess]. The computer plays Black. The program uses a two-ply search which computes material value for both sides and its own piece mobility after Black and White have made their moves.
A very simple chess engine using [https://github.com/niklasf/python-chess python-chess]. The computer plays Black. The program uses a two-ply search which computes material value for both sides and its own piece mobility after Black and White have made their moves.


The default Unicode board may look wonky and misaligned with certain terminal fonts. To use an ASCII board instead (like in the output shown below), replace "print(board.unicode())" with "print(board)".
The default Unicode board may look wonky and misaligned with certain terminal fonts. To use an ASCII board instead (like in the output shown below), replace "print(board.unicode())" with "print(board)" in the "pboard()" function.


If your terminal uses dark mode, change the "pboard()" function to "print(board.unicode(invert_color=True))".
If your terminal uses dark mode, change the "pboard()" function to "print(board.unicode(invert_color=True))".