Cantor set: Difference between revisions

Add BASIC
(Add CLU)
(Add BASIC)
Line 457:
* * * * * * * * * * * * * * * *
</pre>
 
=={{header|BASIC}}==
<lang gwbasic>10 DEFINT A-Z
20 N = 4
30 W = 3^(N-1)
40 S = W
50 L$ = STRING$(W, "#")
60 PRINT L$
70 IF S = 1 THEN END
80 S = S\3
90 P = 1
100 IF P >= W-S GOTO 60
110 P = P+S
120 MID$(L$,P,S) = SPACE$(S)
130 P = P+S
140 GOTO 100</lang>
{{out}}
<pre>###########################
######### #########
### ### ### ###
# # # # # # # #</pre>
 
=={{header|BASIC256}}==
2,114

edits