Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
34
Task/Cantor-set/QBasic/cantor-set.basic
Normal file
34
Task/Cantor-set/QBasic/cantor-set.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
SUB Cantor
|
||||
FOR i = 0 TO alto - 1
|
||||
FOR j = 0 TO ancho - 1
|
||||
intervalo$(i, j) = CHR$(254) '"#"
|
||||
NEXT j
|
||||
NEXT i
|
||||
END SUB
|
||||
|
||||
SUB ConjCantor (inicio, longitud, indice)
|
||||
segmento = INT(longitud / 3)
|
||||
IF segmento = 0 THEN EXIT SUB
|
||||
FOR i = indice TO alto - 1
|
||||
FOR j = inicio + segmento TO inicio + segmento * 2 - 1
|
||||
intervalo$(i, j) = CHR$(32) '" "
|
||||
NEXT j
|
||||
NEXT i
|
||||
CALL ConjCantor(inicio, segmento, indice + 1)
|
||||
CALL ConjCantor(inicio + segmento * 2, segmento, indice + 1)
|
||||
END SUB
|
||||
|
||||
CONST ancho = 81
|
||||
CONST alto = 5
|
||||
DIM SHARED intervalo$(alto, ancho)
|
||||
|
||||
CLS
|
||||
CALL Cantor
|
||||
CALL ConjCantor(0, ancho, 1)
|
||||
FOR i = 0 TO alto - 1
|
||||
FOR j = 0 TO ancho - 1
|
||||
PRINT intervalo$(i, j);
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue