PATHS by twobit

t={}function f(x,y,a,k)k=x*200+y
t[k]=t[k]or(x<1 or y<1)and{1}if not t[k]then
a=f(x-1,y)b=f(x,y-1)c={}i=1 q=0
while a[i]or b[i]or q>0 do
q=q+(a[i]or 0)+(b[i]or 0)c[i]=q%10
q=q/10-q/10%1
i=i+1
end
t[k]=c
end
return t[k]end
while""do a=1*io.read()print(table.concat(f(a,a)):reverse())end

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

download

return to the top page