Chaos game: Difference between revisions

Added XPL0 example.
(Added XPL0 example.)
Line 2,787:
XXX
</pre>
 
=={{header|XPL0}}==
<lang XPL0>int Tx, Ty, X, Y, R;
[SetVid($12); \640x480x4 graphics
Tx:= [320, 320-277, 320+277]; \equilateral triangle
Ty:= [0, 479, 479]; \277 = 480 / (2*Sin(60))
X:= Ran(640); \random starting point
Y:= Ran(480);
repeat R:= Ran(3); \select random triangle point
X:= (X+Tx(R))/2; \new point is halfway to it
Y:= (Y+Ty(R))/2;
Point(X, Y, 2\green\); \plot new point
until KeyHit;
SetVid($03); \restore normal text mode
]</lang>
 
=={{header|Yabasic}}==
772

edits