diff options
Diffstat (limited to 'tests/official-runner-matching.rs')
-rw-r--r-- | tests/official-runner-matching.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/official-runner-matching.rs b/tests/official-runner-matching.rs index 5389558..fb9fb8c 100644 --- a/tests/official-runner-matching.rs +++ b/tests/official-runner-matching.rs @@ -179,6 +179,13 @@ fn read_move(csv_line: &[String], expected_worm_id: i32) -> Command { action: Action::Bomb(Point2d::new(x, y)), } } + "snowball" => { + let (x, y) = read_xy_pair(&csv_line[2]); + Command { + worm: select, + action: Action::Snowball(Point2d::new(x, y)), + } + } "nothing" | "invalid" => Command { worm: select, action: Action::DoNothing, @@ -212,18 +219,18 @@ fn read_xy_pair(input: &str) -> (i8, i8) { let mut char_iter = input.chars(); let _ = char_iter .by_ref() - .take_while(|c| *c != '(') + .take_while(|c| *c != ' ') .collect::<String>(); let x = char_iter .by_ref() - .take_while(|c| *c != ',') + .take_while(|c| *c != ' ') .collect::<String>() .trim() .parse::<i8>() .unwrap(); let y = char_iter .by_ref() - .take_while(|c| *c != ')') + .take_while(|c| *c != ' ') .collect::<String>() .trim() .parse::<i8>() |