LET ancho = 81 LET alto = 5 DIM intervalo$(0,0) MAT REDIM intervalo$(0 TO alto, 0 TO ancho) SUB cantor FOR i = 0 TO alto-1 FOR j = 0 TO ancho-1 LET intervalo$(i, j) = "#" !CHR$(254) NEXT j NEXT i END SUB SUB conjcantor (inicio,longitud,indice) LET 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 LET 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 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