aoc::year2022

Module 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.