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