debugbool
Notes the value on top of the boolean stack so you can look at it from the bot's console, at no cost.
Facts
- Word
debugbool- Family
- Advanced
- Boolean stack
- pops 1, pushes 1
- What it does
- Logs the top of the boolean stack in the bot's trace, without popping it. It costs no energy. With an empty boolean stack it pushes a true.
- Cost
- Advanced command; debugint and debugbool are free
- Runs
- inside a gene: in the condition (cond) and in the body (start or else)
debugbool looks at the value on top of the boolean stack, true or false, and notes it in the bot's trace along with the position of the word in the DNA. It is the counterpart of debugint, useful for finding out what a condition gave. It costs no energy.
cond
*.nrg 1000 >
debugbool
start
10 .up store
stopYou look at the trace with the debug command in the bot's console, in the inspector, and it shows the last cycle.
There is one case in which it does change something: with an empty boolean stack it pushes a true. You almost never notice, because an empty stack already counts as true, but it changes how many values there are. For example, in debugbool 1 2 = swapbool the swapbool has two values to swap and leaves the true on top; without the debugbool, there would be only one false, the swapbool would do nothing and that false would block the stores that follow.