Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
yet another problem
#1
this one's hard to explain.
but the jist of it is, that it lookes at the pixel above and changes the color one up; one down or not at all.
and towreds the bottom it streaks a bit.
it's problably better to see this first
[syntax="QBASIC"]CLS
SCREEN 13 '16-31
RANDOMIZE TIMER
SLEEP 1
a = 14
x = 1: y = 1
DO
c = INT(RND * 3) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF c = 3 THEN a = a
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31

IF y = 2 THEN GOTO 1
PSET (x, y), a
x = x + 1
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
LOOP
1
DO
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
a = POINT(x, y - 1)
c = INT(RND * 3) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF c = 3 THEN a = a
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31

PSET (x, y), a
x = x + 1

LOOP UNTIL y = 200 AND x = 320
SLEEP
END[/syntax]

see what i mean? is this a problem that can fixed or am i skrewed? Smile
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#2
i think i fixed it but there is still a problem:
[syntax="QBASIC"]CLS
SCREEN 13 '16-31
RANDOMIZE TIMER
SLEEP 1
a = 14
x = 1: y = 1
DO
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31

IF y = 2 THEN GOTO 1
PSET (x, y), a
x = x + 1
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
LOOP
1
DO
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
b = POINT(x, y - 1)
a = (a + b) / 2
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31
IF x < 3 THEN GOTO 2
r = POINT(x - 3, y)
t = POINT(x - 2, y - 1)
2
PSET (x, y), a
IF x < 3 THEN GOTO 4
PSET (x - 2, y), (r + t + a) / 3
4
x = x + 1
q = 1
LOOP UNTIL y = 200 AND x = 320
SLEEP
END
[/syntax]
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#3
forget it i fixed it:
[syntax="qbasic"]CLS
SCREEN 13 '16-31
RANDOMIZE TIMER
SLEEP 1
a = 25
x = 1: y = 1
DO
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31

IF y = 2 THEN GOTO 1
PSET (x, y), a
x = x + 1
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
LOOP
1
DO
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
b = POINT(x, y - 1)
a = (a + b) / 2
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31
IF x < 4 THEN GOTO 2
r = POINT(x - 3, y)
t = POINT(x - 2, y - 1)
u = POINT(x - 2, y - 1)
2
PSET (x, y), a
IF x < 3 THEN GOTO 4
IF y <= 1 THEN GOTO 4
PSET (x - 2, y), (r + t + a) / 3
4
x = x + 1
LOOP UNTIL y = 200 AND x = 320
SLEEP
END
[/syntax]

here's what i was origanly(sp) going for:

[syntax="qbasic"]CLS
SCREEN 13 '16-31
RANDOMIZE TIMER
SLEEP 1
a = 25
x = 1: y = 1
DO
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31

IF y = 2 THEN GOTO 1
PSET (x, y), a
x = x + 1
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
LOOP
1
DO
IF x = 320 THEN y = y + 1
IF x = 320 THEN x = 1
b = POINT(x, y - 1)
a = (a + b) / 2
c = INT(RND * 2) + 1
IF c = 1 THEN a = a + 1
IF c = 2 THEN a = a - 1
IF a < 16 THEN a = 16
IF a > 31 THEN a = 31
IF x < 4 THEN GOTO 2
r = POINT(x - 3, y)
t = POINT(x - 2, y - 1)
u = POINT(x - 2, y - 1)
2
PSET (x, y), a
IF x < 3 THEN GOTO 4
IF y <= 1 THEN GOTO 4
PSET (x - 2, y), (r + t + a) / 3
4
x = x + 1
LOOP UNTIL y = 200 AND x = 320
SLEEP
END
[/syntax]

although it does tend to have a vertical ridge going on if you want to fix that Smile
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#4
I copied your program into Word, saved it as a text only file named QB-GRAF.txt file in my QB directory, closed Word, went into Windows Explorer, changed its name to QB-GRAF.BAS, opened QB, opened QB-GRAF.BAS and compiled it into QB-GRAF.EXE.

Hmm, it seems as if the .exe file runs just as fast as the .bas file., taking about 3 seconds for the screen to appear fully. Unfortunately, my Windows XP home Edition minimizes all QuickBASIC-based programs in about 5 to 8 seconds later!

Running it under DOSBox.exe, it takes about 36 seconds to run the .exe file, and opening QB and then running the .bas file, it took about 46 seconds!!! Of course, here, it doesn't close down, as in WinXP.

The program gives me what looks like a fully clouded sky, each time a little different, but, as you say, the orientation of the "streaks" are vertical. Otherwise, very nice.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#5
For DOSBOX, you can use CTRL+F12 to increase the CPU frequnece
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)