Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: Siegfried on December 22, 2008, 12:03:48 AM
-
Hey guys, im pretty new in here, no experience before in programing so I need help with some stuff, I need clear examples of the use of the OR/AND/ELSE commands or whatever they are called, need examples beacuse this place lacks any tutorial or info about them, also I need some help understanding how the one gene bots work because I dont understand how they get their conditions or how do they know against what to react....if do you know what I mean
-
Hey guys, im pretty new in here, no experience before in programing so I need help with some stuff, I need clear examples of the use of the OR/AND/ELSE commands or whatever they are called, need examples beacuse this place lacks any tutorial or info about them, also I need some help understanding how the one gene bots work because I dont understand how they get their conditions or how do they know against what to react....if do you know what I mean
Alright, so first off, always check the wiki (http://www.darwinbots.com/WikiManual/index.php?title=Main_Page), there is some good stuff there, like this (http://www.darwinbots.com/WikiManual/index.php?title=Operators).
The AND/ect. commands are called boolean operators. This means they only perform operations on booleans, and return booleans. On the linked operator page there are some very good examples of how they work, so there is no need for me to restate them.
There are some pretty good resources (http://www.darwinbots.com/Forum/index.php?showtopic=3032)in this forum about one gene bots actually. But, they work essentially just like a bot with multiple genes. As long as you don't have a cond block on your gene, the conditionals will always be evaluated, not necessarily the the non-conditionals however.
start
False
''''Code that is never run
True
''''Code is always run
stop
If you have any specific questions feel free to ask.
-
this might help (http://www.darwinbots.com/Forum/index.php?showtopic=3032)
-
woow, thanks a lot! this is really useful information im surely going to carefully study all of this !tnx guys¡
-
Hi, welcome!
The best way to get to grips with the syntax is to learn how how it works. Two booleans are pushed onto the boolean stack:
'Operators pop numbers from numerical stack and push values on boolean stack
X Y !=
A B >
Then the booleans are taken from the boolean stack and operated on:
'AND operator uses two boolean values and converts them into one value
X Y !=
A B >
and
The sites probably explained this much better, but a good reason to say hello, huh?