Mastermind is a kind of classical board games.
This python project searches the optimal strategy for the Mastermind.
python: 3.7.5, numpy: 1.17.4, sympy: 1.5, matplotlib: 3.1.2
pip install -r requairements.txt
python master_mind.py C P [--policy policy_name]
[--iter code_iter_name]
[--mode mode]
[--no_duplicate]
[--benchmark]
[--log_level]
C and P are the number of colors and pins, respectively.
options
--policy
(Default is minmax)- the details of policies are described in
policy/policy.md
- the details of policies are described in
--iter
(Default is all)- the details of code iterators are described in
code_iter/code_iter.md
- the details of code iterators are described in
--no_duplicate
- the secret and guess code has no color duplication if you use this option.
--mode
(Default is mktree)- select
--mode guess
when you want to know the actual guess code by policies.
- select
--log_level
(Default is critical)- the level of standard output
--benchmark
- execute program for benchmarking policies, codings and so on
Making the search tree according to the policy
--mode mktree
save search tree
python master_mind.py C P [--policy policy_name] [--iter code_iter_name] > savename
Interactively search the guess code according to the policy
--mode guess
If you want to use this program for this online game with default setting, you run python master_mind.py 8 4 --no_duplicate --mode guess
.
code_iter
Code-iterators which is used to search a guess code
policy
Algorithms to search a guess code from feasible codes and the guess history, and so on
utils
Stock common functions