Posts: 17
Threads: 5
Joined: Aug 2003
:evil: i kno im an idiot but how do i put a score thing up i figure that if i put say score% then added a bit on each time it would work but i havnt been able to do the second thing can som1 help :evil:
evil: tell me if this hurts :evil:
Posts: 594
Threads: 11
Joined: Oct 2002
Do you mean a score which increases during playing and then is saved in a file till it's loaded again when the player starts gaming again???
B 4 EVER
Posts: 3,368
Threads: 195
Joined: Jan 2003
When I was your age.... I just looked in the QB Help, since there was no qbasicnews.com back thne.......
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.
Posts: 6,419
Threads: 74
Joined: Mar 2002
I looked at the QB help 'cause there wasn't even internet back then
http://qbasicnews.com/qboho/
Posts: 2,765
Threads: 138
Joined: Nov 2002
like this?
Code:
CLS
DO
LOCATE 1, 5: PRINT score
IF score = 10 THEN PRINT "YOU WIN!"
INPUT a
IF a = INT(RND * 2) + 1 THEN score = score + 1 ELSE score = score - 1
LOOP
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 354
Threads: 11
Joined: May 2002
See if you can follow this 'game'. Type 999 to quit.
Code:
DO
' This generates some random numbers between 1 and 12 for a% and b%
a% = INT(RND * 12) + 1
b% = INT(RND * 12) + 1
'display the score
PRINT "Your score:"; score%
'print the next question
PRINT a%; "x"; b%;
'request input for answer
INPUT "= ", answer%
'quit on 999
IF answer% = 999 THEN EXIT DO
'update the score if correct
IF answer% = a% * b% THEN score% = score% + 1 'update score
LOOP
In a world without walls and doors, who needs Windows and Gates?