Debug info if bot plays
This commit is contained in:
parent
2ccb889d5f
commit
9a2589c553
1 changed files with 5 additions and 7 deletions
12
main.cpp
12
main.cpp
|
@ -19,10 +19,8 @@ int main(int argc, char* argv[]) {
|
|||
int N = stoi(get_input("-n", args, "Length of sequence", "5"));
|
||||
int M = stoi(get_input("-m", args, "Number of colors", "8"));
|
||||
string player = get_input("-p", args, string("Who plays [")+HUMAN+"/"+BOT+"]", "bot");
|
||||
bool learn = "y" == get_input("-l", args, "Do you want to know what bot learns [y/n]", "y");;
|
||||
string gen = RANDOM;
|
||||
if(player != HUMAN)
|
||||
gen = get_input("-g", args, "Who generates the seque", RANDOM);
|
||||
bool learn = "y" == get_input("-l", args, "Do you want to know what bot learns [y/n]", "y");
|
||||
string gen = player == HUMAN ? RANDOM : get_input("-g", args, "Who generates the seque", RANDOM);
|
||||
|
||||
// Generate the sequence
|
||||
auto sequence = vector<int>(N);
|
||||
|
@ -71,12 +69,12 @@ int main(int argc, char* argv[]) {
|
|||
response = validate(sequence, guess);
|
||||
cout << format_response(response);
|
||||
|
||||
if(learn) {
|
||||
if(learn)
|
||||
bot.learn(guess, response);
|
||||
bot.print();
|
||||
}
|
||||
}
|
||||
|
||||
if(learn)
|
||||
bot.print();
|
||||
history.push_back(guess);
|
||||
if(history.back() == sequence) break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue