Module day08

Module day08 

Source
Expand description

Β§Space Image Format

ConstantsΒ§

HEIGHT πŸ”’
LAYER_SIZE πŸ”’
WIDTH πŸ”’

FunctionsΒ§

parse
part1
Each layer is 25 * 6 = 150 bytes and there are 100 layers total.
part2
Since a black or white pixel covers those in lower layers, it’s faster to check each pixel stopping as soon as we hit a non-transparent value.