use std::cli; use std::text; use vendor::game_rounds::game_rounds; fn main() { let arguments = cli_args(); if args_len(arguments) > 0 { if args_len(arguments) % 2 != 0 { stderr_line("Expected event and value pairs"); process_exit(2); } let mut live = game_rounds_start(); let mut i = 0; while i < args_len(arguments) { let input = args_at(arguments, i + 1); if !text_is_number(input) { stderr_line("Expected a whole numeric event value"); process_exit(2); } live = game_rounds_step(live, args_at(arguments, i), text_number(input)); let command = game_rounds_command(live); println!(command); if command == "reject" { process_exit(1); } i += 2; } return; } let mut state = game_rounds_start(); state = game_rounds_step(state, "rounds", 2.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "score", 0.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "challenge", 0.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "score", 0.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "accept", 0.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "score", 0.0); println!(game_rounds_command(state)); state = game_rounds_step(state, "accept", 0.0); println!(game_rounds_command(state)); }