simple octagon tesselation by nn

n=3*$1-2{for(;i<=3*n;){p=int((i<n?n-i+1:i>2*n?i+1-2*n:0)/3)
k=i++%3&&1
for(;j<3*(n-p)+k;j++)printf j<3*p||(j%3?k:!k)?FS:"#"
print j=_}}

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

download

return to the top page