simple octagon tesselation by nn

for(n=readline(i=0)*3-2;p=Math.max(n-i+1,i+1-2*n,0)/3|0,i<=3*n;print(s))for(k=i++%3&&1,s=j='';j<3*(n-p)+k;j++)s+=j<3*p||k^!(j%3)?' ':'#'

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

download

return to the top page