The above video goes away if you are a member and logged in, so log in now!

 Would you like to get all the newest Gaming News fromQJ.NET in your email each day? Want to learn more about the team who brings you the QJ news?

This is a discussion on QBASIC HELp PLEASE ASAP within the General Off Topic+ forums, part of the QJ.net Forum Miscellaneous category; Ok i am having plenty of trouble with q basic and am probally failing i need to prgrams to help ...

 Tweet
1. ## QBASIC HELp PLEASE ASAP

Ok i am having plenty of trouble with q basic and am probally failing i need to prgrams to help my grade ok here is all my gay theacher will tell me he says i need to make a guessing game 1-100 with a random number and i only get maxium of 7 guesses IN the program i have to trap for numbers over 100 and numbers less than 1 i guesse its pretty easy if you know q basic but he really isnt a good teacher

Secondly he wants me to make another game that you enter 2 numbers the first a lower number and a second higher and then have it count in between the 2 with odds on the top and even on the bottom please help me asap THANKS SOOOOOOOOOOOOOOOOOOO MUCH

2. Cls
Randomize Timer
r% = Int(Rnd * 100) + 1
Print "Guess the Number between 1 and 100."
guess% = 0
Print
Do
guess% = guess% + 1
INPUT "Guess: ", g%
If g% < r% Then Print "Too low!"
If g% > r% Then Print "Too high!"
Loop Until g% = r%
Print
Print "You got it in"; guess%; "tries!"

------------------------------------

That's basically the whole thing but you need a do while loop in there that says while guess% <=7.

Anyprobs just email me or add me to msn - me@datapanic.co.uk

3. Cls
Randomize Timer
r% = Int(Rnd * 100) + 1
Print "Guess the Number between 1 and 100."
guess% = 0
Print
Do
guess% = guess% + 1
INPUT "Guess: ", g%
If g% < r% Then Print "Too low!"
If g% > r% Then Print "Too high!"
Loop Until g% = r% or guess% = 7
Print
Print "You got it in"; guess%; "tries!"

think that might work.

4. It works But its the same thing i already have i need it to trap for numbers above 100 and below 1 and if i dont get it in 7 it says i got it ne way do you need a copy of q basic to test it on?

5. Cls
Randomize Timer
r% = Int(Rnd * 100) + 1
Print "THe computer has thought of a number between 1 and 100. See if you can guess it."
guess% = 0
Print
Do
guess% = guess% + 1
INPUT "Guess: ", g%
If g% < r% Then Print "Too low!"
If g% > r% Then Print "Too high!"
Loop Until g% = r% Or guess% = 7
Print
If g% = r% Then Print "Well done!!"
If g% <> r% Then Print "You Lose!"

Thats to get it to say well done or say you lose if you dont get it, I forgot to take the last line out

Gimmie a mo and I'll get the trap working for you.

6. Cls
Randomize Timer
r% = Int(Rnd * 100) + 1
Print "THe computer has thought of a number between 1 and 100. See if you can guess it."
guess% = 0
Print
Do
guess% = guess% + 1
INPUT "Guess: ", g%
If g% > 100 Then Print "That number is too high!"
If g% < 1 Then Print "That number is too low!"
Loop Until g% = r% Or guess% = 7
Print
If g% = r% Then Print "Well done!!"
If g% <> r% Then Print "You Lose!"

There you go.

:)

7. Thanks man i like programming but my teach dosnt give us books and just talks out loud and we are suppose to pick it up cmon and he only helps a few kids out that he likes i am trying to make this other program he wants us to enter a number then a higher number and have the program count all the numbers in between with odds on top and even on the bottom if its not too much trouble can you help me with that aswell
btw man you are a life saver i swear!!!!

8. lol dude I know exactly what your talking about. My computing teacher at school was like that too.

I would help you but I need to go to bed, got work in the morning.

Whens it to be done for?

Add me to msn if you have it.

9. oo man i am sorry i need to make the user know if the guesse is too high or too low i know its easy so i can do that my self THANKs again!

10. Thanks alot for your help its due tommrow morning i have it pretty much under control now thanks a million

11. The one I posted does say if they are too high or too low.

This is the start of your next one:

-----------------------------------------

Cls
Print "Input two numbers and the computer will output the numbers"
Print "between in accordance with odd or even"
num1% = 0
num2% = 0
Print
INPUT "Number one ", num1%
Do
INPUT "Number one ", num2%
If num2% <= num1% Then Print "That number is too low!"
Loop Until num2% > num1%

-----------------------------------------

Good luck buddy.

Kris

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

All times are GMT -8. The time now is 09:15 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY