Module aoc::year2022::day25

source ·
Expand description

§Full of Hot Air

The SNAFU numbers are balanced quinary, similar to an actual base used by some experimental computers.

Functions§

  • from_snafu 🔒
    Converting from SNAFU to decimal is straightforward.
  • to_snafu 🔒
    Convert to decimal by first finding the result modulus 5 for each digit. If the answer is 3 or 4 then we must add a carry to the next digit so account for the subtraction.