Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: MacadamiaNuts on January 09, 2008, 12:38:48 PM

Title: Stubborn conditional
Post by: MacadamiaNuts on January 09, 2008, 12:38:48 PM
I don't get it. I've got this code:

Code: [Select]
start
...
clearbool

*.waste 100 >
*.waste .shootval store
-4 .shoot store
clearbool

And the waste shoot executes always.

But if I use:

Code: [Select]
start
...
clearbool

*.waste 100 >
-4 .shoot store
*.waste .shootval store
clearbool

The condition works right. Why? I'm using 2.43y.
Title: Stubborn conditional
Post by: EricL on January 09, 2008, 12:42:05 PM
Perhaps the bot is aquiring waste every cycle.  Perhaps it's a bug.  I will need a sim to investigate.
Title: Stubborn conditional
Post by: MacadamiaNuts on January 09, 2008, 01:24:36 PM
Gimme some time. I'm trying to replicate it with a simpler bot, cos LF7 is nightmarish.
Title: Stubborn conditional
Post by: MacadamiaNuts on January 09, 2008, 02:06:33 PM
Nailed it. There was a duplicated store lower in the code, like:

Code: [Select]
*.waste 100 >
*.waste .shootval store
-4 .shoot store
clearbool
(properly coded stuff)
store

Without the clearbool between, nothing happened, but with the clearbool, the command  was executed.