1
AA
222
bbbb
33333
cccccc
CLS s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END
Method 1: Using SUB END SUB
DECLARE SUB pattern(s$) CLS s$ = "1A2b3c" CALL pattern(s$) END SUB pattern (s$) FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END SUB
Method 1: Using FUNCTION END FUNCTION
DECLARE FUNCTION pattern$(s$) CLS r$ = pattern$(s$) END FUNCTION pattern$ (s$) s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END FUNCTION
Post a Comment