day2: 255

This commit is contained in:
Christoph Stahl 2022-12-02 23:35:02 +01:00
parent 566465da30
commit d9a20b1012
3 changed files with 2519 additions and 0 deletions

16
day2.hs Normal file
View file

@ -0,0 +1,16 @@
a 89=66
a 88=65
a 90=67
a i=i
p i=i-64
a%b=q$mod(a-b)3
q 2=6
q 0=3
q 1=0
v(x:_:z:[])=z+x%z
y(1:_:3:[])=8
y(1:_:i:[])=2+i
y(2:_:i:[])=1+((i-1)*4)
y(3:_:1:[])=2
y(3:_:i:[])=4+i
main=interact$show.((,).(sum.map v)<*>(sum.map y)).map(map(p.a.fromEnum)).lines

2500
day2long Normal file

File diff suppressed because it is too large Load diff

3
day2short Normal file
View file

@ -0,0 +1,3 @@
A Y
B X
C Z