Author Topic: The OR Command  (Read 3519 times)

Offline Havvy

  • Bot Neophyte
  • *
  • Posts: 16
    • View Profile
The OR Command
« on: July 02, 2007, 05:44:54 AM »
Code: [Select]
cond
 *.nrg 1000 <
 *.body 50 >
 or
 start

How would this DNA event work?

Also, if directly following a 'else' there is a 'cond', will it work like an elseif?
« Last Edit: July 02, 2007, 06:29:40 AM by Havvy »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
The OR Command
« Reply #1 on: July 02, 2007, 08:58:30 AM »
Quote
cond
*.nrg 1000 <
*.body 50 >  
or
start

If one of this two is true, the gene is activated(the commands after start are being executed). This is standing somewhere in the wiki too, it's handy if you look there   . There you can find interesing things.

Quote
Also, if directly following a 'else' there is a 'cond', will it work like an elseif?

I am not sure, I tried it once but then I could'nt do it, maybe I was just doing it wrong  .

You mean something like this I gues

Quote
cond
*.nrg 1000 <
*.body 50 >  
or
start


else         (the else part I gues you mean)
   cond
   start
   else
   stop
stop
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
The OR Command
« Reply #2 on: July 02, 2007, 08:41:45 PM »
else gets activated whenever start doesn't.  The most straightforward example would be something like this:

cond
*.nrg 5000 >
start
50 .repro store
else
0 .repro store
stop

This basically acts as an if-else block.