Guess My Number
#1
This is probably the oldest BASIC game I've ever made back in High School in the 80's. I was bored today so I threw it together again with QB64. 
Guess the computer's number from 1 to 100. It adds up how many tries you take. 

Code: (Select All)
start:
Randomize Timer
number = Int(Rnd * 100) + 1
tries = 0
Cls
Do
    Print: Print
    tries = tries + 1
    Print tries; ". ";
    Input "Guess My Number (1-100): ", g
    If g = number Then
        Print: Print "Correct!"
        Print: Print "It took you "; tries; " tries."
        Print: Input "Again (Y/N)?", ag$
        If Left$(ag$, 1) = "y" Or Left$(ag$, 1) = "Y" Then GoTo start:
        End
    End If
    If g > number Then Print: Print "Your number is too high."
    If g < number Then Print: Print "Your number is too low."
Loop
Reply


Messages In This Thread
Guess My Number - by SierraKen - 09-18-2022, 11:04 PM
RE: Guess My Number - by PhilOfPerth - 09-18-2022, 11:11 PM
RE: Guess My Number - by bplus - 09-19-2022, 12:25 AM
RE: Guess My Number - by SierraKen - 09-20-2022, 09:23 PM
RE: Guess My Number - by DANILIN - 09-25-2022, 12:47 PM
RE: Guess My Number - by mnrvovrfc - 09-25-2022, 05:21 PM
RE: Guess My Number - by SierraKen - 09-25-2022, 08:21 PM
RE: Guess My Number - by mnrvovrfc - 09-26-2022, 05:16 AM
RE: Guess My Number - by SierraKen - 09-25-2022, 08:24 PM
RE: Guess My Number - by DANILIN - 11-07-2022, 10:45 AM
RE: Guess My Number - by DANILIN - 02-23-2023, 02:45 AM
RE: Guess My Number - by Sprezzo - 02-24-2023, 02:33 PM
RE: Guess My Number - by DANILIN - 02-24-2023, 04:22 PM
RE: Guess My Number - by bplus - 02-24-2023, 04:36 PM
RE: Guess My Number - by DANILIN - 02-24-2023, 04:52 PM
RE: Guess My Number - by bplus - 02-24-2023, 05:09 PM
RE: Guess My Number - by DANILIN - 04-04-2023, 08:35 AM
RE: Guess My Number - by SMcNeill - 04-04-2023, 10:58 AM
RE: Guess My Number - by DANILIN - 05-20-2023, 03:36 AM



Users browsing this thread: 12 Guest(s)