Sierpinski Fractal by flagitious

a=1
n=2**gets.to_i
loop{puts' '*(n-=1)+('%b'%a).tr('0',' ').gsub(/1.1.?/,'/__\\').gsub(/.?1/,'/\\')
a^=a*4}

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

download

return to the top page