Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help!
#1
I was hoping someone could tell me how to make my program only let the user take only 4 guesses at something.
Reply
#2
Code:
x = x + 1
if x > 4 then
  print "no more guesses for you"
  end
end if

if you want more be more specific in your question, there's no one way.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
Well, here's a simple implication using the solution that toonski stated:
Code:
RANDOMIZE TIMER
num=INT(RND*10) + 1
FOR i=1 TO 4
CLS
PRINT "Guess number ";i
INPUT "Guess: ",guess
IF guess=num THEN PRINT "Correct!": EXIT FOR
NEXT i
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#4
something like this in qbasic.com. homework alert! :bounce:
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
#5
perhaps he doesn't know qbasic.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)