hehe
This commit is contained in:
parent
2cf807f941
commit
76a1f9c330
|
@ -23,10 +23,9 @@ fn part1(id: u64, game: &str) -> Result<u64> {
|
|||
.map(|poll| -> Result<bool> {
|
||||
let (count, colour) = n_colour_pair(poll)?;
|
||||
Ok(match colour {
|
||||
"red" if count <= 12 => true,
|
||||
"green" if count <= 13 => true,
|
||||
"blue" if count <= 14 => true,
|
||||
"red" | "green" | "blue" => false,
|
||||
"red" => count <= 12,
|
||||
"green" => count <= 13,
|
||||
"blue" => count <= 14,
|
||||
c => {
|
||||
bail!("Invalid colour: {c}, expected red, green or blue")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue