Hi all,
There is a way to put two condition as a part of a Test Box in a Etoys script. We can add more operant to a condition, but all the operators are aritmetic ones: "+", "-", "*", "//", and "\" but there is a way to create a Test condition with "and" or "or"?
I don't know if I made myself clear enough.
Cheers,
Offray
Hi, Offray!
For the present, one has to use *nested* Test Boxes to achieve the effect of the "ands" and "ors" you want.
Thus, where you want, for example
TEST ((elmer's x < 5) and (elmer's y < 5)) YES elmer make sound croak
this could be constructed as:
TEST elmer's x < 5 YES TEST elmer's y < 5 YES elmer make sound croak
or (to explicate my shorthand):
or, if you wanted code in the NO branch as well,
TEST (a and b) YES <some action> NO <some other action>
would be achieved by:
TEST a YES TEST b YES <some action> NO <some other action> NO <some other action>
and similarly for the (non-exclusive) OR,
TEST (a or b) YES <some action>
would translate into:
TEST a YES <some action> NO TEST b YES <some action>
etc.
Cheers,
-- Scott
On Oct 26, 2006, at 3:28 PM, Offray Vladimir Luna Cárdenas wrote:
Hi all,
There is a way to put two condition as a part of a Test Box in a Etoys script. We can add more operant to a condition, but all the operators are aritmetic ones: "+", "-", "*", "//", and "\" but there is a way to create a Test condition with "and" or "or"?
I don't know if I made myself clear enough.
Cheers,
Offray _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
squeakland@lists.squeakfoundation.org