[Tutor] Help with Guess the number script

spir denis.spir at gmail.com
Tue Mar 11 14:12:43 CET 2014


On 03/11/2014 04:32 AM, Scott W Dunning wrote:
>
> On Mar 8, 2014, at 11:50 AM, Scott dunning <swdunning at cox.net> wrote:
>>>>
>>>> And now that you have the right set of tests you can
>>>> half the number of lines by combining your if
>>>> conditions again, like you had in the original
>>>> post. ie. Bring your hot/cold/warm tests together.
> I’m having a hard time doing that because the guess can be either too low or too high but it is always either cold, warm, or on fire.  I can’t figure out how to make it work with out splitting the cold, warm and on fire under two branches, one too low and one too high.  Any suggestions?

Well, what is the meaning of "absolute value"? Cold, warm, or on fire depend on 
the distance between both numbers, secret and guess, right?

d


More information about the Tutor mailing list