Skip to content

Added new optional filters to main script#34

Open
craigjmclaughlin wants to merge 3 commits into
vitogit:masterfrom
craigjmclaughlin:master
Open

Added new optional filters to main script#34
craigjmclaughlin wants to merge 3 commits into
vitogit:masterfrom
craigjmclaughlin:master

Conversation

@craigjmclaughlin

Copy link
Copy Markdown

New optional parameters to main.py address several requested issues
Added:
--color=WHITE Generate puzzles only for preferred color. WHITE/W, BLACK/B, or default NONE
--opening= '1. e4 e5 2. f4' Generate puzzles stemming from opening. Default is NONE
--forcedMate=TRUE Only generate puzzles with a forced checkmate. Default is False
--minTurn=10 Generate puzzles from turns >= minTurn. Default is 0
--maxTurn=50 Generate puzzles from turns <= maxTurn. Default is 999

Comment thread README.md
- `--includeBlunder=False` If False then generated puzzles won't include initial blunder move, default is `True`
- `--stockfish=./stockfish-x86_64-bmi2` Path to Stockfish binary.
Optional. If omitted, the program will try to locate Stockfish in current directory or download it from the net
- `--color=WHITE` Generate puzzles only for preferred color. `WHITE`/`W`, `BLACK`/`B`, or default `NONE`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a test to make sure that the filters are working correctly?
For example with this game.pgn file https://gist.github.com/vitogit/8e1059e57929a9fde4f69232eca6c1f2
Running python3 main.py --depth=5 --games=game.pgn it generates 3 puzzles
Running python3 main.py --depth=5 --games=game.pgn --color=WHITE it generate 1 puzzle
Running python3 main.py --depth=5 --games=game.pgn --color=BLACK it generate 1 puzzle when it should to generate 2.

Comment thread README.md
Optional. If omitted, the program will try to locate Stockfish in current directory or download it from the net
- `--color=WHITE` Generate puzzles only for preferred color. `WHITE`/`W`, `BLACK`/`B`, or default `NONE`
- `--opening= '1. e4 e5 2. f4` Generate puzzles stemming from opening. Default is `NONE`
- `--forcedMate=TRUE` Only generate puzzles with a forced checkmate. Default is `False`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using forcedMate=TRUE and forcedMate=FALSE returns 0 puzzles

@vitogit vitogit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I think there are some filters that are not working as it should

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants