my solutions to advent of code
aoc advent-of-code

skibidi

aylac.top 295ce3e9 ef60f2b2

verified
Changed files
+2 -2
2025
1
gleam
rust
src
+1 -1
2025/1/gleam/src/main.gleam
···
acc.zeroes
+ case acc.turn != 0 && raw_new_number <= 0 {
// if it is below zero before being moduloed and the original number itself wasn't zero it means that it did touch zero but the division thing wouldn't count it, so we give this extra support.
-
// of course, there is no need to deal with a negative to positive situation because the turn will never be negative!!!
True -> raw_zeroes + 1
False -> raw_zeroes
}
···
acc.zeroes
+ case acc.turn != 0 && raw_new_number <= 0 {
// if it is below zero before being moduloed and the original number itself wasn't zero it means that it did touch zero but the division thing wouldn't count it, so we give this extra support.
+
// of course, there is no need to deal with a negative to positive situation because the acc.turn will never be negative!!!
True -> raw_zeroes + 1
False -> raw_zeroes
}
+1 -1
2025/1/rust/src/main.rs
···
State {
turn,
// if it is below zero before being moduloed and the original number itself wasn't zero it means that it did touch zero but the division thing wouldn't count it, so we give this extra support.
-
// of course, there is no need to deal with a negative to positive situation because the turn will never be negative!!!
zeroes: acc.zeroes + raw_zeroes + (acc.turn != 0 && raw_turn <= 0) as i32,
}
},
···
State {
turn,
// if it is below zero before being moduloed and the original number itself wasn't zero it means that it did touch zero but the division thing wouldn't count it, so we give this extra support.
+
// of course, there is no need to deal with a negative to positive situation because the acc.turn will never be negative!!!
zeroes: acc.zeroes + raw_zeroes + (acc.turn != 0 && raw_turn <= 0) as i32,
}
},