1. And/ Or in One
- Posted by Andy <videogamefreak101 at hotmail.co?> Jul 07, 2007
- 577 views
Is there a command in Euphoria that allows for the and/or command to be one. Like saying if event here then attack him and/or her. I hope I am making enough senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm trying to explain it as well.
2. Re: And/ Or in One
- Posted by Juergen Luethje <j.lue at gmx.?e> Jul 07, 2007
- 580 views
Andy wrote: > Is there a command in Euphoria that allows for the and/or command to be one. > > Like saying if event here then attack him and/or her. I hope I am making > enough > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > trying > to explain it as well. Euphoria has the following built-in logical operators: and, or, xor, not see http://rapideuphoria.com/refman_2.htm#24 I don't know what your "and/or" should mean logically. Maybe after reading this page http://en.wikipedia.org/wiki/Truth_table you can tell more precisely what you are looking for. Regards, Juergen
3. Re: And/ Or in One
- Posted by don cole <doncole at p?cbell.net> Jul 07, 2007
- 551 views
- Last edited Jul 08, 2007
Andy wrote: > > Is there a command in Euphoria that allows for the and/or command to be one. > > Like saying if event here then attack him and/or her. I hope I am making > enough > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > trying > to explain it as well. Hello Andy, All though I'm not much into games, I would say if event then attack him. I don't know why she is involved. I would think you would need more code like, Does he exist?, Does she exist? if he exist then attack him elsif she exist the attack her elsif both exist attack both Hope this helps. It's the best I can do based on the small amount of info you have provided. Don Cole
4. Re: And/ Or in One
- Posted by Mike <vulcan at win.co?nz> Jul 08, 2007
- 559 views
Andy wrote:> > Is there a command in Euphoria that allows for the and/or command to be one.> > Like saying if event here then attack him and/or her. I hope I am making > enough > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > trying > to explain it as well. Andy, As you (should) know OR has the same effect as our english expression "either or". In other words if one or both elements are True then proceed..otherwise don't. Eg, 1 or 0 -- TRUE 1 or 1 -- TRUE 0 or 1 -- TRUE 0 or 0 -- FALSE Why don't construct a Truth Table (like this one) to explain what you are after? regards, Mike
5. Re: And/ Or in One
- Posted by Mike <vulcan at win.co?nz> Jul 08, 2007
- 553 views
Mike wrote: > > > Andy wrote:> > > Is there a command in Euphoria that allows for the and/or command to be > > one.> > > Like saying if event here then attack him and/or her. I hope I am making > > enough > > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > > trying > > to explain it as well. > > Andy, > > As you (should) know OR has the same effect as our english expression "either > or". > In other words if one or both elements are True then proceed..otherwise don't. > Eg, > > 1 or 0 -- TRUE > 1 or 1 -- TRUE > 0 or 1 -- TRUE > 0 or 0 -- FALSE > > Why don't construct a Truth Table (like this one) to explain what you are > after? > > regards, > Mike Oops, or is "and or" xor is "either or" sorry. Mike
6. Re: And/ Or in One
- Posted by Pete Lomax <petelomax at blu?yonder.co.uk> Jul 08, 2007
- 543 views
Mike wrote: > Oops, > > or is "and or" > xor is "either or" > > sorry. Err: or is "either" xor is "one but not both" sorry. Pete
7. Re: And/ Or in One
- Posted by Robert Craig <rds at RapidEuphor?a.com> Jul 08, 2007
- 553 views
Andy wrote: > Is there a command in Euphoria that allows for the and/or command to be one. > > Like saying if event here then attack him and/or her. I hope I am making > enough > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > trying > to explain it as well. The Euphoria "or" is equivalent to the English "and/or". In English, people say "and/or" to stress that A or B or both could be true. In English "or" can also mean "and/or", but it's a bit ambiguous sometimes. In English we often say something that is logically ambiguous because we are talking to another human, not a computer. Two humans will often have a common understanding of the context in which something is said, and it may be obvious whether both A and B could both be true, or not. Thus it is humorous when someone asks, e.g. Q: "Are you going to keep working here, or quit?" A: "Yes" People realize that the answer is logical, but funny (or sarcastic), because both parties know that A and B is not possible, so the person replying is expected to choose one of them. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
8. Re: And/ Or in One
- Posted by CChris <christian.cuvier at a?riculture.gouv.fr> Jul 08, 2007
- 554 views
Andy wrote: > > Is there a command in Euphoria that allows for the and/or command to be one. > > Like saying if event here then attack him and/or her. I hope I am making > enough > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > trying > to explain it as well. What you want to achieve appears to be done by:
if he exist ehtn attack him end if if she exist then attack her end if </eucode The only potential issue there is, when both enemies are present, "he" is always attacked before "he", while you'd like some other logic to apply. If so, no operator will do all the work, you are going to code a little bit more. If not, then the above looks good enough, doesn't it?
CChris }}}
9. Re: And/ Or in One
- Posted by Andy <videogamefreak101 at hotm?il.com> Jul 08, 2007
- 549 views
OK I figured it out, sorry if I caused any confusion.
10. Re: And/ Or in One
- Posted by Ricardo Forno <ricardoforno at tutopia.c?m> Jul 09, 2007
- 569 views
Juergen Luethje wrote: > > Andy wrote: > > > Is there a command in Euphoria that allows for the and/or command to be one. > > > > Like saying if event here then attack him and/or her. I hope I am making > > enough > > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > > trying > > to explain it as well. > > Euphoria has the following built-in logical operators: > and, or, xor, not > see <a > href="http://rapideuphoria.com/refman_2.htm#24">http://rapideuphoria.com/refman_2.htm#24</a> > > I don't know what your "and/or" should mean logically. > Maybe after reading this page > <a > href="http://en.wikipedia.org/wiki/Truth_table">http://en.wikipedia.org/wiki/Truth_table</a> > you can tell more precisely what you are looking for. > > Regards, > Juergen Hi Juergen. Euphoria has another built-in (hidden) logical operator when applied to Boolean data, although it does not have a bit level counterpart. It is "=", which amounts to "not xor". "!=" can also replace xor if used with Boolean data. Regards.
11. Re: And/ Or in One
- Posted by Juergen Luethje <j.lue at gmx.?e> Jul 10, 2007
- 553 views
Ricardo Forno wrote: > Juergen Luethje wrote: > > > > Andy wrote: > > > > > Is there a command in Euphoria that allows for the and/or command to be > > > one. > > > > > > Like saying if event here then attack him and/or her. I hope I am making > > > enough > > > senese. Its it like xor or something. I'm sorry, if I'm confusing, but I'm > > > trying > > > to explain it as well. > > > > Euphoria has the following built-in logical operators: > > and, or, xor, not > > see <a > > href="http://rapideuphoria.com/refman_2.htm#24">http://rapideuphoria.com/refman_2.htm#24</a> > > > > I don't know what your "and/or" should mean logically. > > Maybe after reading this page > > <a > > href="http://en.wikipedia.org/wiki/Truth_table">http://en.wikipedia.org/wiki/Truth_table</a> > > you can tell more precisely what you are looking for. > > > > Regards, > > Juergen > > Hi Juergen. > Euphoria has another built-in (hidden) logical operator when applied to > Boolean data, although it does not have a bit level counterpart. > It is "=", which amounts to "not xor". > "!=" can also replace xor if used with Boolean data. > Regards. Hi Ricardo, yes, of course! Thanks for reminding me. Regards, Juergen