Difference between revisions of "Execution Flag"
From WikiManual
(→The code that does it all) |
m (fmt) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone. | In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone. | ||
− | = The code that does it all = | + | == The code that does it all (Visual Basic) == |
Instead of trying to explain it all, which I'm sure I'd fail at, I'll just post the code that does it. This isn't exactly the same code that's in the program. I modified it a bit to make it more readable. | Instead of trying to explain it all, which I'm sure I'd fail at, I'll just post the code that does it. This isn't exactly the same code that's in the program. I modified it a bit to make it more readable. | ||
Line 25: | Line 23: | ||
I don't remember what the default values are for CurrentFlow and CurrentCondFlag. | I don't remember what the default values are for CurrentFlow and CurrentCondFlag. | ||
+ | |||
+ | ==How the DNA works== | ||
+ | * [[Genes]] | ||
+ | * [[Execution Flag]] | ||
+ | * The [[Stack]] | ||
+ | * [[Custom labels]] (or variables if you prefer) |
Latest revision as of 14:16, 7 January 2006
In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone.
The code that does it all (Visual Basic)
Instead of trying to explain it all, which I'm sure I'd fail at, I'll just post the code that does it. This isn't exactly the same code that's in the program. I modified it a bit to make it more readable.
Select Case n Case 1 'cond CurrentFlow = COND Case 2, 3, 4 'assume a stop command, or it really is a stop command 'this is supposed to come before case 2 and 3, since these commands 'must be executed before start and else have a chance to go If CurrentFlow = COND Then CurrentCondFlag = AddupCond() 'ANDs all conditions CurrentFlow = CLEAR Select Case n Case 2 'start If CurrentCondFlag = NEXTBODY Then CurrentFlow = BODY Case 3 'else If CurrentCondFlag = NEXTELSE Then CurrentFlow = ELSEBODY End Select End Select
The store commands will only operate if CurrentFlow is set to something other than CLEAR.
I don't remember what the default values are for CurrentFlow and CurrentCondFlag.
How the DNA works
- Genes
- Execution Flag
- The Stack
- Custom labels (or variables if you prefer)