ArcBasicDocs

tutorials/beginner

04_guess.abs

21 lines of ArcBasic. Words in colour that are commands link to their help page. To run it, download ArcBasic, open the file and press F5.

Download 04_guess.absAll files in this folder

04_guess.abs
; Guess my number - keep going until you get itSeedRnd MilliSecs()secret = Rand(1, 100)tries = 0Print "I'm thinking of a number from 1 to 100."Repeat	guess = Input("Your guess? ")	tries = tries + 1	If guess < secret Then Print "Higher!"	If guess > secret Then Print "Lower!"Until guess = secretPrint "Yes! It was " + secret + ". You took " + tries + " tries."If tries <= 7 Then Print "That's excellent guessing."WaitKeyEnd