Zigzag by uru

var n,i,j,d:comp=1;s:array[byte]of string;begin
read(n,s[0]);repeat
for n:=1to n do s[n]:=s[n]+s[0][ord(n=j)+1];j:=j+d;if j in[1,n]then d:=-d;inc(i)until
i=255;for j:=1to n do writeln(s[j]:2*n*n-4*n+2+j)end. 

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

download

return to the top page