Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make this better.
#1
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.......

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
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Messages In This Thread
Make this better. - by Agamemnus - 09-11-2003, 06:14 AM
Make this better. - by LinkMaster Sab - 09-11-2003, 06:28 AM
Make this better. - by Agamemnus - 09-11-2003, 06:53 AM
Make this better. - by LinkMaster Sab - 09-11-2003, 07:50 AM
Make this better. - by Agamemnus - 09-11-2003, 05:44 PM
Make this better. - by Neo - 09-11-2003, 06:42 PM
Make this better. - by Agamemnus - 09-11-2003, 07:18 PM
Make this better. - by LinkMaster Sab - 09-13-2003, 01:16 AM
Make this better. - by Agamemnus - 09-17-2003, 01:55 AM
Make this better. - by Agamemnus - 10-01-2003, 06:14 AM
Make this better. - by Diroga - 10-01-2003, 08:12 AM
Make this better. - by Agamemnus - 10-01-2003, 04:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)