better cli interface

This commit is contained in:
Maximilian Keßler 2023-08-09 22:50:03 +02:00
parent d95f40e2ae
commit 1c6792a693
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -109,7 +109,6 @@ int main(int argc, char *argv[]) {
#ifndef NDEBUG
test();
#endif
// check_games(2, 9);
if(argc == 3) {
std::string game(argv[1]);
std::string turn (argv[2]);
@ -118,6 +117,17 @@ int main(int argc, char *argv[]) {
} catch(std::invalid_argument&) {
Hanabi::download(game.c_str(), std::stoi(turn));
}
} else if (argc == 2) {
int player_count = std::stoi(argv[1]);
if (player_count == 3) {
check_games(3, 10);
} else if (player_count == 4) {
check_games(4, 9);
} else if (player_count == 5) {
check_games(5, 9);
} else if (player_count == 2) {
check_games(2, 10);
}
} else {
Hanabi::print_usage(argv[0]);
}