let rps_result = vec![4, 1, 7, 8, 5, 2, 3, 9 ,6]; fn main() { let score = include_str!("../../example").lines().fold(0, parse_line); } fn parse_line(score: usize, line: &str) -> usize { let mut moves = line.split(' '); let opponent_move = moves.next().unwrap(); let my_move = moves.next().unwrap(); match opponent_move { "A" => 1, "B" => 2, "C" => 3, _ => unreachable!(), }; 0 + score }