Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Elite on January 25, 2006, 12:51:59 PM
-
Can you use 'else' like this?
cond
start
stop
else
stop
How do you use 'else'?
-
Yes, you can use it that way.
Also, you don't actually need to stop after body. It's automatically assumed that when you encounter else you stop the execution before it.
Also, else and body need not be in any particular order.
cond
else
stop
would execute if cond resolved to false.
This is in 2.4, but not 2.37.
-
Ah, I was wondering why it wasn't working.
So you can make genes in 2.4 that can execute in two ways depending on the condition? Interesting ...
-
Yes, the idea was to increase the possible complexity of DNA structure, to hopefully let more advanced genes develop. (I'm also working on other methods as we speak. If you have any ideas yourself feel free to suggest them).