Python implementation of the game of chess.
Project description
Introduction
Performance
Using python3 -m cProfile -o prof.txt tree.py -h
for profiling and snakeviz prof.txt
to
visualize.
Perft(3) initial positions rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
(8902
positions, reference time 0.05 with python-chess
:
- 1.25 s (first)
- 0.79 s (moving`get_positions_attacking_pieces` to optimizer initialization and update, not when checking if move
is legal) - 0.70 removing np.array from list of moves (does not make a lot of sense)
TODO:
- [X] Include tests for perft in different positions
- [ ] Utils if there is a mismatch in positions
- [ ] Improve performance
- [ ] Improve overall code quality (clarity, choose right data structure for the job)
- [ ] Automate release with github action to pip
- [ ] Explore pypy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for chess-under-1000-lines-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae4c86d9e3f90827b3a344ecdab817dbfd1f5cc2c8a92e8ba935fb956aaa555 |
|
MD5 | c7b4b8277016d687268e1cd00ace96ad |
|
BLAKE2b-256 | 1cb7dd2904792f8f449fa2154d2fc18cdb2b3f972e56f6127253ab0d8f45ede2 |
Close
Hashes for chess_under_1000_lines-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f72b7a9759d088d07b1a5b545275f11e70f0d461d90d13fd4801ed8c33cb3bb |
|
MD5 | 2bd21dc760c5932cba8c333b9a55beca |
|
BLAKE2b-256 | c2a1dfcb524f3a403d1406268f3a38c3798eb8202dd135411b4f08177216eb4e |