Sierpinski triangle/Graphical: Difference between revisions

(→‎{{header|XPL0}}: Added zkl)
Line 1,220:
SetVid(3); \restore normal text display
]</lang>
 
=={{header|zkl}}==
Uses the PPM class from http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#zkl
{{trans|XPL0}}
<lang zkl>const Order=8, Size=(1).shiftLeft(Order);
img:=PPM(300,300);
foreach y,x in (Size,Size){ if(x.bitAnd(y)==0) img[x,y]=0xff0000 }
img.write(File("foo.ppm","wb"));</lang>
{{out}}
Same as the BBC BASIC image but with red and another order of triangles.
 
[[File:sierpinski_triangle_bbc.gif]]
 
{{omit from|ACL2}}
Anonymous user