Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: AZPaul on March 29, 2005, 01:03:43 PM

Title: Math stack issue
Post by: AZPaul on March 29, 2005, 01:03:43 PM
I feel so [you](*&% [/you]incompetent.

How could something so [you]&*^%[/you] simple cause me so much [you]&^%&#@[/you] headache!

Eye values:  0 0 0 0 0 0 24 24 24

Gene:

'
'----- #21  Something to the right - turn
'
cond
  *.eye5 *.eye4 add *.eye6 add 0 =
  *.eye7 *.eye9 add *.eye1 sub *.eye3 sub 0 >
start
  100 .aimdx store
stop

Unless I have a totally bogus view of how the [you]&(*^^#[/you] math stack works both of these [you]&^$@@%*)[/you] conditionals should return me a [you]*&%$@[/you] "true."

So why the ever lovin [you]&^%$[/you] won't this stupid [you]%*&^[/you] gene fire?

No other genes executed during the cycle (but this one was supposed to, the [you]&^%$[/you] thing). So what the [you]*&^$@#*((&%[/you] is going on here?

Embarassingly yours,

-P
Title: Math stack issue
Post by: PurpleYouko on March 29, 2005, 01:25:30 PM
Sorry to inform you of this but.......

[span style=\'font-size:14pt;line-height:100%\']MATH FUNCTIONS DON'T WORK IN CONDITIONS![/span]

Sorry  :)
Title: Math stack issue
Post by: PurpleYouko on March 29, 2005, 01:32:33 PM
Try this

Code: [Select]
cond
start
*.eye5 *.eye4 add *.eye6 add 55 store
' stores result of condition into mem cell 55
*.eye7 *.eye9 add *.eye1 sub *.eye3 sub  56 store
' stores result of condition into mem cell 56
stop

cond
*55 0 =
*56 0 >
start
100 .aimdx store
stop

it will do  exactly the same thing that you were trying to acheive but by storing the results of your conditions into memory cells first then comparing memory value in the following gene.

Long winded ? maybe but definitely possible.
Title: Math stack issue
Post by: Numsgil on March 29, 2005, 01:57:37 PM
I'm going to get on math in conditionals soon.  It's all part of my grand reaching Junk DNA/Chromosome idea that is probably at least as massive as the enzyme system, if not a bit simpler in the biological aspect.
Title: Math stack issue
Post by: AZPaul on March 29, 2005, 02:04:18 PM
Quote
Sorry to inform you of this but.......

MATH FUNCTIONS DON'T WORK IN CONDITIONS!




 Say what? :shoot:

 :burnup:  :banghead:  :cuss:  :cuss:  :tantrum:  :shoot:  :bash:  :cuss:  :rant:  :pokey:  :bash:  :plzdie:  :shoot:
Title: Math stack issue
Post by: Numsgil on March 29, 2005, 02:53:09 PM
yeah, I think Anonymous Guest Person was having a problem with that a while ago too.