TGC Codebase Backup



Basic Guessing Game by Quirkyjim

9th Nov 2008 16:57
Summary

Just a simple numbet guessing game: you get three chances.



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `Number guessing game

cls
Print "Guessing game!"
Print "You'll get three chances to get it!"
mynum# = RND(100)
Input "Guess a number 1 - 100 ", guessnum#

firstguess:
if guessnum# = mynum#
	print "Wow!, you're REALLY good at this!"
	wait 2000
	goto exit
	else	
		if guessnum#>mynum#
		print "Go lower!"
		goto secondguess
		else
			if guessnum#<mynum#
			print "Go higher!"
			goto secondguess
			endif
		endif
endif

secondguess:
Input "Guess again! ", guessnum#
if guessnum# = mynum#
	print "You're pretty good!"
	wait 2000
	goto exit
	else
		if guessnum#>mynum#
		print "Go lower!"
		goto finalguess
		else
			if guessnum#<mynum#
			print "Go higher!"
			goto finalguess
			endif
		endif
endif

finalguess:
input "What is your FINAL guess? ", guessnum#
if guessnum# = mynum#
	print "Good, you got it!"
	wait 2000
	goto exit
	else
		print "Aww, too bad, you didn't get it..."
		Print
		Print "(By the way, the number was ";mynum# ;")"
		wait 2000
		goto exit
endif

exit:
print "Thanks for playing!"
wait key