[Tutor] Help with Guess the number script
Scott dunning
swdunning at cox.net
Sat Mar 8 19:50:43 CET 2014
> On Mar 8, 2014, at 3:57 AM, spir <denis.spir at gmail.com> wrote:
>
>> On 03/08/2014 10:13 AM, Alan Gauld wrote:
>>> On 08/03/14 01:23, Scott W Dunning wrote:
>>>
>>> On Mar 7, 2014, at 11:02 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>>>
>>> GOT IT!! Finally! Thanks for all of your help!!
>>>
>>> This is what I got, not sure if it’s correct but it’s working!
>>
>> Well done.
>> 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.
Yeah I'm gonna try that. The reason I split it up in the first place is I couldn't get it to work properly being all together (ie Either too high or too low yet always either cold, warm, or on fire).
>
> Yes, and note the relevant piece of data is the absolute value: abs(secret-guess). This gives you at once on-fire / hot / warm / cold / icy ... whatever you like ;-) (pretty sexy game, guess-my-number!).
>
Hmm, not sure I understand.
More information about the Tutor
mailing list