day 1 more robust
[aoc_eblake.git] / 2022 / day25.c
blobac4ae038191c60c75b1a205c16f864731d94193d
1 #include<stdio.h>
2 char*q,a[75],*p=a,d;int main(void){for(q=p+50;q-p;*p++=5)++*q--;for(;~scanf(
3 "%s",q=a+50);){for(p=a+25;d=*q;*q++=d>2?d-2:-d)d=d%9%6;for(++d;q--,p---a;
4 d/=5)d+=*p+*q,*p=d%5+3;}for(;*++p;d||putchar("=-012"[*p-3]))d&=*p<6;}