Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chess-under-1000-lines-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chess_under_1000_lines-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file chess-under-1000-lines-0.1.0.tar.gz.

File metadata

  • Download URL: chess-under-1000-lines-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.2 Linux/5.15.0-1019-azure

File hashes

Hashes for chess-under-1000-lines-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cae4c86d9e3f90827b3a344ecdab817dbfd1f5cc2c8a92e8ba935fb956aaa555
MD5 c7b4b8277016d687268e1cd00ace96ad
BLAKE2b-256 1cb7dd2904792f8f449fa2154d2fc18cdb2b3f972e56f6127253ab0d8f45ede2

See more details on using hashes here.

File details

Details for the file chess_under_1000_lines-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chess_under_1000_lines-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f72b7a9759d088d07b1a5b545275f11e70f0d461d90d13fd4801ed8c33cb3bb
MD5 2bd21dc760c5932cba8c333b9a55beca
BLAKE2b-256 c2a1dfcb524f3a403d1406268f3a38c3798eb8202dd135411b4f08177216eb4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page