<!---
Name:        guess3.cfm
Author:      Ben Forta (ben@forta.com)
Description: Demonstrate use of multiple if statements
Created:     3/27/01
--->

<HTML>
<HEAD>
   <TITLE>Guess the Number - 3</TITLE>
</HEAD>

<BODY>

<!--- Pick a random number --->
<CFSET RandomNumber=RandRange(1, 10)>

<!--- Check if number was passed --->
<CFIF IsDefined("URL.guess") AND (RandomNumber IS URL.guess)>
   <!--- It matched --->
   <CFOUTPUT>
   You got it, I picked #RandomNumber#! Good job!
   </CFOUTPUT>
<CFELSEIF IsDefined("URL.guess") AND (RandomNumber IS NOT URL.guess)>
   <!--- Did not match --->
   <CFOUTPUT>
    Sorry, I picked #RandomNumber#! Try again!
   </CFOUTPUT>
<CFELSE>
   <!--- No guess specified, give instructions --->
   You did not guess a number.<BR>
   To guess a number, reload this page adding
   <B>?guess=n</B> (where n is the guess, for
   example, ?guess=5). Number should be between
   1 and 10.
</CFIF>

</BODY>
</HTML>

