RosettaCodeData/Task/Sierpinski-triangle-Graphical/BASIC/sierpinski-triangle-graphical.basic
2023-07-01 13:44:08 -04:00

14 lines
204 B
Text

SCREEN 9
H=.5
P=300
FOR I=1 TO 9^6
N=RND
IF N > 2/3 THEN
X=H+X*H:Y=Y*H
ELSEIF N > 1/3 THEN
X=H^2+X*H:Y=H+Y*H
ELSE
X=X*H:Y=Y*H
END IF
PSET(P-X*P,P-Y*P)
NEXT