Diamond Knockout by rolf

e n|n>0=1+10*e(n-1)
 |n<1=0
z[]=[]
z('0':xs)=' ':z xs
z(x:xs)=x:z xs
d 0=[]
d n=n`mod`10-1:d(n`div`10)
l k=[show$e k^2-(e i^2+e(i*2-1)*(k-i)-e(i-2)^2*100)*10^(k-i)|i<-d$e k^2]
main=interact(z.unlines.l.read)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page