PDA

View Full Version : I got a question with If/Else Statements


NobhillFunny
01-25-2008, 11:40 AM
Ok i have a project where i need to make an If/Else Statement, the criteria is that i have 3 objects for example a fire hydrant and two dogs, well i need to make the statement tell me which one is closer to the hydrant, and I'm not quite sure on how to do that. Much appreciation if i could get some help.


Nick

DickBaldwin
01-25-2008, 01:46 PM
Ok i have a project where i need to make an If/Else Statement, the criteria is that i have 3 objects for example a fire hydrant and two dogs, well i need to make the statement tell me which one is closer to the hydrant, and I'm not quite sure on how to do that. Much appreciation if i could get some help.


Nick

See http://www.dickbaldwin.com/tocalice.htm

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

NobhillFunny
01-26-2008, 07:17 PM
thanks for the reply but that didn't help me at all really. i just need to know what function to create, number,bollion, object, other... and then how i would input that to the if/else

marriott
01-27-2008, 07:43 PM
Hi,

This page may be helpful:

http://catb.org/~esr/faqs/smart-questions.html

Reza Aprian
01-31-2008, 07:00 AM
cant u just do something like

(this is a pseudocode)

if dogA distance to object < dogB distance to object
dogA.say "i'm closer";
else
if dogB distance to object < dogA distance to object
dogB.say "i'm closer";
else
do together
dogA.say "we are in same distance!";
dogB.say "we are in same distance!";
else
do nothing;