Sierpinski triangle/Graphical: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: modified the code to work with the latest version of Sidef) |
m (→{{header|zkl}}: added image) |
||
Line 1,406: | Line 1,406: | ||
=={{header|zkl}}== |
=={{header|zkl}}== |
||
[[File:SierpinskiTriangle.zkl.jpg|150px|thumb|right]] |
|||
Uses the PPM class from http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#zkl |
Uses the PPM class from http://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#zkl |
||
{{trans|XPL0}} |
{{trans|XPL0}} |
||
Line 1,411: | Line 1,412: | ||
img:=PPM(300,300); |
img:=PPM(300,300); |
||
foreach y,x in (Size,Size){ if(x.bitAnd(y)==0) img[x,y]=0xff0000 } |
foreach y,x in (Size,Size){ if(x.bitAnd(y)==0) img[x,y]=0xff0000 } |
||
img.write(File(" |
img.write(File("sierpinskiTriangle.ppm","wb"));</lang> |
||
{{out}} |
|||
Same as the BBC BASIC image but with red and another order of triangles. |
|||
http://www.zenkinetic.com/Images/RosettaCode/sierpinskiTriangle.jpg |
|||
{{omit from|ACL2}} |
{{omit from|ACL2}} |