Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
As an example, here is how it can be done in QBasic.
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
QBasic 135 129 Characters
As an example, here is how it can be done in QBasic.
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
QBasic 151 Characters
As an example, here is how it can be done in QBasic.
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
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 T=1/3 P=300 FOR I=1 TO 9^6 N=RND IFNIF>N<=T2/3 THEN X=X*HX=H+X*H:Y=Y*H ELSEIFNELSEIF>N>T1/H3 THEN X=H+X*HX=H^2+X*H:Y=Y*H Y=H+Y*H ELSE X=H^2+X*HX=X*H:Y=H+Y*HY=Y*H END IF PSET(P-X*P,P-Y*P) NEXT
QBasic 135 Characters
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 T=1/3 P=300 FOR I=1 TO 9^6 N=RND IFN<=T THEN X=X*H:Y=Y*H ELSEIFN>T/H THEN X=H+X*H:Y=Y*H ELSE X=H^2+X*H:Y=H+Y*H END IF PSET(P-X*P,P-Y*P) NEXT
QBasic 135 129 Characters
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 P=300 FOR I=1 TO 9^6 N=RND IFN>2/3 THEN X=H+X*H:Y=Y*H ELSEIFN>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
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 T=.T=1/3 P=300 FOR I=1 TO 9^6 N=RND IF N<=T THEN X=X*H:Y=Y*H ELSEIF N>T/H THEN X=H+X*H:Y=Y*H ELSE X=H^2+X*H:Y=H+Y*H END IF PSET(P-X*P,P-Y*P) NEXT
QBasic 134 Characters
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 T=.3 P=300 FOR I=1 TO 9^6 N=RND IF N<=T THEN X=X*H:Y=Y*H ELSEIF N>T/H THEN X=H+X*H:Y=Y*H ELSE X=H^2+X*H:Y=H+Y*H END IF PSET(P-X*P,P-Y*P) NEXT
QBasic 135 Characters
As an example, here is how it can be done in QBasic.
SCREEN 9 H=.5 T=1/3 P=300 FOR I=1 TO 9^6 N=RND IF N<=T THEN X=X*H:Y=Y*H ELSEIF N>T/H THEN X=H+X*H:Y=Y*H ELSE X=H^2+X*H:Y=H+Y*H END IF PSET(P-X*P,P-Y*P) NEXT