better cli interface
This commit is contained in:
parent
d95f40e2ae
commit
1c6792a693
1 changed files with 11 additions and 1 deletions
12
main.cpp
12
main.cpp
|
@ -109,7 +109,6 @@ int main(int argc, char *argv[]) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
test();
|
test();
|
||||||
#endif
|
#endif
|
||||||
// check_games(2, 9);
|
|
||||||
if(argc == 3) {
|
if(argc == 3) {
|
||||||
std::string game(argv[1]);
|
std::string game(argv[1]);
|
||||||
std::string turn (argv[2]);
|
std::string turn (argv[2]);
|
||||||
|
@ -118,6 +117,17 @@ int main(int argc, char *argv[]) {
|
||||||
} catch(std::invalid_argument&) {
|
} catch(std::invalid_argument&) {
|
||||||
Hanabi::download(game.c_str(), std::stoi(turn));
|
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 {
|
} else {
|
||||||
Hanabi::print_usage(argv[0]);
|
Hanabi::print_usage(argv[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue