Difference between revisions of "Cond"
From WikiManual
(6 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
=Condition= | =Condition= | ||
− | '''cond''' marks the start of a gene in the DNA. Everything from cond to [[start]] is | + | '''cond''' marks the start of a gene in the DNA. Everything from cond to [[start]] is evaluated. Once the program reaches start, any values still on the conditions stack are anded together. If the resulting boolean value is true, every [[action]] after start to the next stop command is executed. |
Otherwise, the program continues to the next cond statement, or stops reading the DNA if the [[end]] is found instead. | Otherwise, the program continues to the next cond statement, or stops reading the DNA if the [[end]] is found instead. | ||
− | The condition is the part of the gene | + | The condition is the part of the gene and tells if it should be activated or not. Many action commands can be used in here but not all. |
− | + | example: | |
− | + | ||
− | * | + | '''cond''' |
− | + | *.eye5 50 > | |
− | + | '''start''' | |
+ | -1 .shoot store | ||
+ | '''stop''' | ||
+ | '''end''' | ||
+ | |||
+ | |||
+ | {{Flow Commands}} |
Latest revision as of 09:14, 1 July 2014
Condition
cond marks the start of a gene in the DNA. Everything from cond to start is evaluated. Once the program reaches start, any values still on the conditions stack are anded together. If the resulting boolean value is true, every action after start to the next stop command is executed.
Otherwise, the program continues to the next cond statement, or stops reading the DNA if the end is found instead.
The condition is the part of the gene and tells if it should be activated or not. Many action commands can be used in here but not all.
example:
cond *.eye5 50 > start -1 .shoot store stop end
Flow Commands: |