Code center > Suggestions
Gene structure - cond start stop
EricL:
I think we need two. I can imagine cases where you want to clear the boolean stack for genome flow control reasons but keep your integer stack state.
I'm curious what do you mean by dumping the stack to DNA?
Numsgil:
oops, heh, typo. I meant "that dumps both stacks from the DNA".
Gobo:
It would be also nice to have a command that drops the top value from the boolean stack. It is an extremely important functionality, since it has sense of ENDIF. As for now, I couldn't express it with less than three commands: true or and. I think it's highly expensive (moreover difficult to evolve!) for such basic operation.
EricL:
Sounds good to me. So, I'll add four new commands:
clearbool - empties the boolean stack.
clearint - empties the integer stack
popbool - pops a value off the boolean stack.
popint - pops a value off the integer stack
Okay?
Botsareus:
I don't like the idea of using cond bla start for else statements.
Here is what I propose:
--- Quote ---*.eye5 50 > ' Call this C
.shoot dec ' happens if C is true
else
314 rnd .aimsx store 'happens if C is false
--- End quote ---
--- Quote ---A 'condition
B 'condition
C and 'condition
D 'action
or
E 'action
else
F 'action
--- End quote ---
means:
--- Quote ---cond
A
B
C
and
and
start
D
stop
cond
A
B
C
and
or
start
E
stop
cond
A
B
C
and
or
else
start
F
stop
--- End quote ---
look here:
cond
A
B
C
and
or
else
start
F
stop
If B or C is false, and A is false then run F
--- Quote from: EricL ---Sounds good to me. So, I'll add four new commands:
clearbool - empties the boolean stack.
clearint - empties the integer stack
popbool - pops a value off the boolean stack.
popint - pops a value off the integer stack
Okay?
--- End quote ---
I like the conditionless command better because then you don't have to worry about were to put the stop. I will add it myself when I get a chance to program on the outside.
I love the clearbool , clearint commands because I will need them in my extreamly complex sexrepro system.
As far as popbool and popint commands see this post with updates: http://www.darwinbots.com/Forum/index.php?showtopic=2266
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version