Day 13: 365
This commit is contained in:
parent
67e38fc1c3
commit
26e44e8e8c
1 changed files with 10 additions and 0 deletions
10
d13golf.hs
Normal file
10
d13golf.hs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import Data.List
|
||||||
|
a=map
|
||||||
|
p(x,_:y)=s(a(read.('(':).(++")"))x,a(((,).(!!0)<*>read.drop 2).drop 11)y)
|
||||||
|
m f=maximum.a f
|
||||||
|
d i=[[last$'.':['#'|(x,y)`elem`i]|x<-[0..m(fst)i]]|y<-[0..m(snd)i]]
|
||||||
|
x&n=n-abs(n-x)
|
||||||
|
i%('x',n)=a(\(x,y)->(x&n,y))i
|
||||||
|
i%('y',n)=a(fmap(&n))i
|
||||||
|
s(i,z)=scanl(%)i z
|
||||||
|
main=getContents>>=((>>).(mapM putStrLn.d.last)<*>(print.length.nub.(!!1))).p.break(==[]).lines
|
Loading…
Add table
Reference in a new issue