I like how brain dead simple my #AdventOfCode day 2 in #Rust is https://github.com/kellan/aoc/blob/main/2022/rust/day2-rock-paper-scissors/src/main.rs
aoc/main.rs at main · kellan/aoc
Contribute to kellan/aoc development by creating an account on GitHub.GitHub
silwol
•Michael Forster
•I went with short AND unreadable:
input.lines().map(|line| {
let elf = line.as_bytes()[0] - b'A';
let me = line.as_bytes()[2] - b'X';
(me + 1 + (4 + me - elf) % 3 * 3) as u64
}).sum()
😉
silwol reshared this.