Darwinbots Forum
Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: triclops200 on May 16, 2010, 02:00:20 AM
-
Can i have more conditions inside of my gene after the cond statement?
-
yes. I'm not quite sure if they are ANDded with the pre cond statements though. I've always assumed they are, but I have the vague recollection someone said they're not. If you find out let me know.
-
how do I do it, give an eample plz, someone.
-
how do I do it, give an eample plz, someone.
look up my gimmick bot, it's full of it.
-
I cant find your gimmick bot
-
Yes, just use the boolean operators. For example:
cond
*.eye5 0 >
*.refpoison 0 =
start
becomes
start
*.eye5 0 >
*.refpoison 0 =
and
you can also use "OR's" instead of creating new genes so:
cond
*.eye5 0 =
start
cond
*.myeye *.refeye =
start
becomes:
start
*.eye5 0 =
*.myeye *.refeye =
or
As I understand it, it places a true or a false on top of the boolean stack based on the value that the condition command returned (=, <, >, !=, etc.) I'm not sure, but I think "start's" without a condition also return true, or maybe their just skipped if the condition is false. Whatever the case, stores and incs/decs are not activated when theres a false ontop of the stack. I think the default value is true by the way. I hope that makes sense, if you want more detail check the wiki. By the way, theres also XOR and NOT.
-
ok, but how would I condense
cond
*.eye5 0 >
start
-1 .shoot store
stop
using logic iside of start
-
ok, but how would I condense
cond
*.eye5 0 >
start
-1 .shoot store
stop
using logic iside of start
*.eye5 0 >
-1 .shoot store
Gimmick:
http://www.darwinbots.com/Forum/index.php?showtopic=3043 (http://www.darwinbots.com/Forum/index.php?showtopic=3043)
-
I made an Inline Conditions Tutorial (http://www.darwinbots.com/WikiManual/index.php/Inline_Conditions_Tutorial) a while ago that may be helpful to you.