I thought stack is never cleared unless some function removes values from it? Why do you say:
it seems pointless to display the stack as each the eye is added, then delete them again when the gene is finished
OK, here is what I was thinking. It should very-very basic, for people like me, who don't program much or for newbies. Some optional shortcuts may be available for advanced users to skip some of the stuff described below.
We have four windows:
- one shows DNA,
- one shows all memory locations (with special ones, like sysvars, highlighted slightly),
- one shows stack and condition stack.
- one shows stuff like energy, which bot depends on, but has no direct control over
You can modify any of these values manually if you want to. Like type in 5000 into energy.
You load the DNA in, press "GO" and program starts from the top. Say your gene 3 is actually one and only gene 1 in DNA. It goes like this:
cond
*.eye1
'program asks you for *.eye1 value, you input 52 (alternative - you actually place a second bot on a special tiny window so that values are measured automatically and realistically)
'you see 52 appearing on the stack
*.eye5
'program asks you for *.eye5 value, you input 10
'you see 10 appearaing at the top of the stack and 52 moving down
>
'you see 52 and 10 blinking a couple of times, then they disappear from stack and "true" appears on condition stack
'We see message: "Gene is activated!"
start
25
'25 appears on stack
.aimsx
'6 appears on top of stack and 25 is moved down on stack
store
'6 and 25 blink a couple of times and disappear from stack, memory location 6 blinks a couple of times and you see 25 appearing there
stop
end
Program shows summary window:
energy spent: blah-blah
actions taken: bot is turned N degrees to the left
Three buttons on summary window: "Start over", "Go to next cycle", "Done"
"Start over" resets all values and goes through DNA again (in case you missed something)
"Go to next cycle" processes all values and continues execution of DNA.
"Done" allows you to change things in all four windows, like change DNA, change mem location, values and so on. This way if you spot the problem in DNA, you can fix it right here in the window.
The reason I want it to be so basic is two-fold: 1. Coding for newbies will become much easier. 2. Analysis of complex (and especially evolved bots) will be much easier.
The problem with evolved bots is that they do a lot of crap that sometimes actually gets something done. And it is a hell to try and trace every single thing that they do, becasue they often do it in a non-straightforaward way. Tool like that would allow to easily spot things like stack overflows, weird actions and so on.