Chaos game: Difference between revisions
Content added Content deleted
(Added Quackery.) |
No edit summary |
||
Line 1,840: | Line 1,840: | ||
end |
end |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|M2000 Interpreter}}== |
|||
{{trans|Locomotive Basic}} |
|||
Old style programming (GOTO, ON GOTO) inside Module. Export bitmap to Clipboard. |
|||
<syntaxhighlight lang="m2000 interpreter"> |
|||
Module Chaos { |
|||
01 Read Ox as integer, Oy as Integer |
|||
02 def Screen$ |
|||
05 cls 0,0 // black background, row for split screen |
|||
10 def integer x,y,i,v |
|||
20 x = 640 * rnd |
|||
30 y = 400 * rnd |
|||
40 for i=1 to 20000 |
|||
50 v = rnd * 2 + 1 |
|||
60 on v goto 70,100,130 |
|||
70 x = x/2 |
|||
80 y = y/2 |
|||
90 goto 150 |
|||
100 x = 320 + (320-x)/2 |
|||
110 y = 400 - (400-y)/2 |
|||
120 goto 150 |
|||
130 x = 640 - (640-x)/2 |
|||
140 y = y/2 |
|||
150 pset v*2, x*twipsX+Ox,y*twipsY+Oy |
|||
160 next i |
|||
170 Move Ox, Oy |
|||
180 Copy 640*twipsX, 400*twipsY to Screen$ |
|||
190 Clipboard Screen$ |
|||
} |
|||
Call Chaos 3000, 3000 |
|||
</syntaxhighlight> |
|||
{{output}} |
|||
[[File:Chaosgame.png|thumb]] |
|||
=={{header|Maple}}== |
=={{header|Maple}}== |
||
<syntaxhighlight lang="maple">chaosGame := proc(numPoints) |
<syntaxhighlight lang="maple">chaosGame := proc(numPoints) |