Package: chessboard
CLI to solve combinatoric chess puzzles.Stable release:Development:MotivationThis project started its life as a coding challenge I was asked to solve while
interviewing in 2015 for a software engineering position atUber.After the interview proccess ended, I kept toying with the code, as a playground
to test some optimization strategies in Python. It is now a boilerplate that
I use to:bootstrap CLI-based projects powered withClick,keep up with the current state-of-art ofPython packaging,streamline the integration of a data stack (Numpy,Pandas,SeabornandConda),automatetesting and quality checks(unit-tests,
coverage, coding style and packaging),provide anauto-generated documentation.ExamplesSimple 3x3 board with 2 kings and a rook:$chessboardsolve--length=3--height=3--king=2--rook=1<SolverContext: length=3, height=3, pieces={'rook': 1, 'king': 2, 'queen': 0, 'bishop': 0, 'knight': 0}>
Searching positions...
┌───┬───┬───┐
│ ♚ │   │   │
├───┼───┼───┤
│   │   │ ♜ │
├───┼───┼───┤
│ ♚ │   │   │
└───┴───┴───┘
┌───┬───┬───┐
│   │   │ ♚ │
├───┼───┼───┤
│ ♜ │   │   │
├───┼───┼───┤
│   │   │ ♚ │
└───┴───┴───┘
┌───┬───┬───┐
│ ♚ │   │ ♚ │
├───┼───┼───┤
│   │   │   │
├───┼───┼───┤
│   │ ♜ │   │
└───┴───┴───┘
┌───┬───┬───┐
│   │ ♜ │   │
├───┼───┼───┤
│   │   │   │
├───┼───┼───┤
│ ♚ │   │ ♚ │
└───┴───┴───┘
4 results found in 0.03 seconds.Famous eight queens puzzle, without printing the solutions to speed things up:$chessboardsolve--length=8--height=8--queen=8--silent<SolverContext: length=8, height=8, pieces={'rook': 0, 'king': 0, 'queen': 8, 'bishop': 0, 'knight': 0}>
Searching positions...
92 results found in 119.87 seconds.Huge combinatoric problem can take some time to solve:$chessboardsolve--length=7--height=7--king=2--queen=2--bishop=2--knight=1--silent<SolverContext: length=7, height=7, pieces={'rook': 0, 'king': 2, 'queen': 2, 'bishop': 2, 'knight': 1}>
Searching positions...
3063828 results found in 9328.33 seconds.The CLI allow the production of a profiling graph, to identify code hot spots and
bottleneck:.$chessboardsolve--length=6--height=6--king=2--queen=2--bishop=2--knight=1--silent--profile<SolverContext: length=6, height=6, pieces={'rook': 0, 'king': 2, 'queen': 2, 'bishop': 2, 'knight': 1}>
Searching positions...
23752 results found in 207.25 seconds.
Execution profile saved at /home/kevin/chessboard/solver-profile.pngThird-partyThis project package’s boilerplate is sourced from thecode I wroteforScaleway’spostal-address module, which is published under aGPLv2+ License.The CLI code is based on the one I wrote for thekdenlive-tools module, published under aBSD
license.Other resourcesAwesome Chess: curated list of assetsCombinatorial GenerationApplied CombinatoricsExtremal ProblemsCombinatorial AlgorithmsChanges for v1.5.4 (2017-08-11)Show selected log level in debug mode.Drop support and unittests on Mac OS X 10.9.Add new macOS 10.12 target for Travis CI builds.Bump requirement toreadme_renderer >= 16.0.Move installation instructions to documentation.Move performance page to documentation.Move CLI usage to own section in docs.Activate unittests in Python 3.6.Show environment variables in Travis jobs for debugging.Check there is no conflicting dependencies in Travis jobs.Show the graph of package dependencies in documentation.Fix upgrade ofsetuptoolsinmacOS+ Python 3.3 Travis jobs.Full changelog.