Skip to content

nariaki3551/master_mind_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

master_mind_cpp

A solver of master_mind coded by c++.


Install

git clone https://github.com/nariaki3551/master_mind_cpp.git

Setting

Docker

run

docker build -t master_mind .

, then

docker run -v $(pwd):/mnt -it master_mind

By yourself

mkdir source
cd source
git clone https://github.com/p-ranav/argparse
git clone https://github.com/prakhar1989/progress-cpp.git

and, install packages, for example, in the case on ubuntu,

apt update -y && apt-get update -y
apt-get install -y tzdata
apt-get install -y build-essential cmake vim git valgrind screen \
                   libpthread-stubs0-dev libgtest-dev libomp-dev \
                   libopenmpi-dev

Build

CMake

mkdir build
cd build
cmake ..
make

The binary will be created as bin/mastermind.

If you use MPI parallelization, then

cmake .. USE_MPI=ON

Usage

$ ./bin/mastermind
Usage: master mind [options] num_colors num_pins 

Positional arguments:
num_colors     	number of colors
num_pins       	number of pins

Optional arguments:
-h --help      	shows help message and exits
-v --version   	prints version information and exits
--policy       	type of policy: random, minmax, exp_minmax, entropy [default: "random"]
--no_duplicate 	secret codes donot have color duplication [default: false]
--test         	run test mode [default: false]

About

A solver of master_mind coded by c++.

Resources

License

Stars

Watchers

Forks

Packages

No packages published