Walk the line by zetamatta

T={}
function f(x,y)return((T[y]or{})[x]or 0)>32 and 1 or 0;end
for L in io.lines()do T[#T+1]={L:byte(1,#L)};end
x=1;y=1
while T[y][x]do
io.write(string.char(T[y][x]))
T[y][x]=nil
x,y=x+f(x+1,y)-f(x-1,y),y+f(x,y+1)-f(x,y-1)
end

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

download

return to the top page