What if....
Robert Sneidar
slylabs13 at me.com
Tue Jan 29 14:56:01 EST 2013
False 1!
False 2!
Got it 3!
Got it 4!
Off the top of my head.
Bob
On Jan 28, 2013, at 4:36 AM, Thierry Douez wrote:
> Hi Peter,
>
> 2013/1/27 Peter Haworth <pete at lcsql.com>
>
>> Musings about complex if statements on this Sunday morning...
>>
>> if cond1 and cond2 and cond3 and cond4 then.....
>>
>> if cond1 then
>> if cond2 then
>> if cond3 then
>> if cond4 then...
>>
>> if cond1 and cond2 and (cond3 and cond4) then....
>>
>> Just curious.
>> Pete
>>
>
> Wanting to show you in few lines of code, some differences with or wihtout
> the (),
> I came accros this interesting riddle...
>
> So, smart livecoders, try to guess what would be the 4 answers to this
> script;
> then run it and thanks to comment :)
>
>
> on mouseUp
> if false or true and false then
> answer "Got it 1!"
> else
> answer "False 1!"
> end if
> if false or (true and false) then
> answer "Got it 2!"
> else
> answer "False 2!"
> end if
> if false or true then
> answer "Got it 3!"
> else
> answer "False 3!"
> end if
> if false and false or true then
> answer "Got it 4!"
> else
> answer "False 4!"
> end if
> end mouseUp
>
>
> Regards,
>
> Thierry
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list