1. And/ Or in One

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.

new topic     » topic index » view message » categorize

2. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: And/ Or in One

Mike wrote:
> Oops,
> 
> or is "and or"
> xor is "either or"
> 
> sorry.
Err:
or is "either"
xor is "one but not both"

sorry. blink

Pete

new topic     » goto parent     » topic index » view message » categorize

7. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

8. Re: And/ Or in One

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 }}}

new topic     » goto parent     » topic index » view message » categorize

9. Re: And/ Or in One

OK I figured it out, sorry if I caused any confusion.

new topic     » goto parent     » topic index » view message » categorize

10. Re: And/ Or in One

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.

new topic     » goto parent     » topic index » view message » categorize

11. Re: And/ Or in One

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu