Sierpinski Fractal by mskzzzz

A+B+C:-atom_concat(A,B,C).
X-A-S-T:-A<1,I is X-2,length(M,I),maplist(=(32),M),U+' '+S,format('~s~a
~s~a
',[M,U,M,T]);(A/\1<1,U='    ',D=U;U=' /\\ ',D='/__\\'),S+U+V,T+D+W,X-A//2-V-W.
X:A:-X<1,!;X-A-''-'',B is A*2 xor A,X-2:B.
m:-prompt1(''),readln(N),2**N:1.

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

download

return to the top page