09-11-2003, 06:14 AM

Basic program (er) is from a question on qbasic.com. how to do:

for i% = 1 to n%

for j% = 1 to n-1

for k% = 1 to n-2

for l% = 1 to n-3

for m% = 1 to 2

next i%

etc.

n% times.

--------------------

A gradient is good.

Could also change numbers to symbols.... or shades... or change the equation.......

for i% = 1 to n%

for j% = 1 to n-1

for k% = 1 to n-2

for l% = 1 to n-3

for m% = 1 to 2

next i%

etc.

n% times.

--------------------

A gradient is good.

Could also change numbers to symbols.... or shades... or change the equation.......

Code:

`CLS : n% = 9: DIM SHARED val1(2 TO n%) AS INTEGER`

FOR i% = 2 TO n%: val1(i%) = 1: NEXT i%: combo& = 1

DO

combo2$ = LTRIM$(STR$(combo&))

c1% = ((combo& \ 10) AND 15) + 1: FOR i% = 1 TO LEN(combo2$): COLOR c1%

PRINT MID$(combo2$, i%, 1); : c1% = c1% + 1: IF c1% > 15 THEN c1% = 1

NEXT i%

val1%(2) = val1%(2) + 1: i% = 2: combo& = combo& * val1%(2) / (val1%(2) - 1)

DO

IF val1%(i%) > i% THEN

IF i% = n% THEN GOTO exitdo2

combo& = combo& \ val1%(i%): val1%(i%) = 1: i% = i% + 1

val1(i%) = val1(i%) + 1: combo& = combo& * val1%(i%) \ (val1%(i%) - 1)

ELSE EXIT DO

END IF

LOOP

LOOP

exitdo2: COLOR 7