| * handle no readline | * handle no readline | ||||
| * named pipes (a.k.a FIFOs) | |||||
| * eV = expected value = return | |||||
| * check that the card distribution is uniform | |||||
| * initial bankroll | |||||
| * report | |||||
| * as a file | |||||
| * format (yaml, json, markdown table) | |||||
| * size (extra small, small, medium, large, extra large) | |||||
| * flat_bet implies =1 | |||||
| * parse 1e5 in hands | * parse 1e5 in hands | ||||
| * trap ctrl+c and write report anyway | |||||
| * trap ctrl+c and write report anyway (not sure how to pass arguments to signal handler) | |||||
| * flag to see if a conf string was used or not | * flag to see if a conf string was used or not | ||||
| * to_string() for floats | * to_string() for floats | ||||
| * max_splits through conf (default 3) | * max_splits through conf (default 3) |
| if (set(player, {"player"}) == false) { | if (set(player, {"player"}) == false) { | ||||
| // if we are on an interactive terminal we play through tty otherwise stdinout | // if we are on an interactive terminal we play through tty otherwise stdinout | ||||
| if (isatty(0) && isatty(1)) { | |||||
| if (isatty(fileno(stdin)) && isatty(fileno(stdout))) { | |||||
| player = "tty"; | player = "tty"; | ||||
| } else { | } else { | ||||
| player = "stdio"; | player = "stdio"; |
| // assign player to dealer | // assign player to dealer | ||||
| dealer->setPlayer(player); | dealer->setPlayer(player); | ||||
| // TODO: check and/or choose in the conf | |||||
| // std::setlinebuf(stdout); | |||||
| // std::setvbuf(stdout, NULL, _IOLBF, 0); | |||||
| // std::setvbuf(stdin, NULL, _IOLBF, 0); | |||||
| // let the action begin! | // let the action begin! | ||||
| unsigned int unknownCommands = 0; | unsigned int unknownCommands = 0; | ||||
| dealer->nextAction = Libreblackjack::DealerAction::StartNewHand; | dealer->nextAction = Libreblackjack::DealerAction::StartNewHand; |