Bots and Simulations > DNA - General

How do you use 'else'?

(1/1)

Elite:
Can you use 'else' like this?


--- Code: ---cond
start
stop
else
stop
--- End code ---

How do you use 'else'?

Numsgil:
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.

Elite:
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 ...

Numsgil:
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).

Navigation

[0] Message Index

Go to full version