Qbasicnews.com July 18, 2019, 09:29:18 PM  Pages: Author Topic: yet another problem  (Read 1696 times)
Dio
I hold this place together     Posts: 874  « on: January 09, 2005, 10:40:45 PM »

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?  Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Dio
I hold this place together     Posts: 874  « Reply #1 on: January 09, 2005, 11:34:03 PM »

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] Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Dio
I hold this place together     Posts: 874  « Reply #2 on: January 09, 2005, 11:57:58 PM »

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  Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Ralph
Ancient Guru    Posts: 544 « Reply #3 on: January 12, 2005, 08:33:45 PM »

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. Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
retsyo
Member Posts: 73 « Reply #4 on: January 12, 2005, 11:55:13 PM »

For DOSBOX, you can use CTRL+F12 to increase the CPU frequnece Logged
 Pages: