Author Topic: How do you use 'else'?  (Read 3554 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
How do you use 'else'?
« on: January 25, 2006, 12:51:59 PM »
Can you use 'else' like this?

Code: [Select]
cond
start
stop
else
stop

How do you use 'else'?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
How do you use 'else'?
« Reply #1 on: January 25, 2006, 02:15:58 PM »
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.

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
How do you use 'else'?
« Reply #2 on: January 25, 2006, 04:17:45 PM »
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 ...
« Last Edit: January 25, 2006, 04:50:16 PM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
How do you use 'else'?
« Reply #3 on: January 25, 2006, 05:05:02 PM »
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).
« Last Edit: January 25, 2006, 05:05:23 PM by Numsgil »