Bots and Simulations > DNA - General

Eyes and reverse polish notation issue

<< < (2/2)

Testlund:
Ha! I finally got it right! I just had to keep changing the numbers, but the pattern doesn't seem logical to me. I expected the number marked with red to be 6.


--- Code: ---start
250 .eye3dir store
75 .eye4dir store
-75 .eye6dir store
-250 .eye7dir store
stop

start
250 .eye3width store
100 .eye4width store
45 .eye5width store
100 .eye6width store
250 .eye7width store
stop

Sweep the eyes
cond
 *.robage 2
start
 0 .focuseye store
stop

cond
*.robage 4 mod 0 =
start
-1 .focuseye store
stop

cond
*.robage 4 mod 1 =
start
1 .focuseye store
stop

cond
*.robage 6 mod 0 =
start
-6 .focuseye store
stop

cond
*.robage 6 mod 1 =
start
[color=red]2[/color] .focuseye store
stop

cond
 *.eyef 0 >
 *.reftype 1 !=
 *.refeye *.myeye <
start
 *.refxpos *.refypos angle .setaim store
 *.refveldx .dx store
 *.refvelup 32 add .up store
 -6 .shoot store
stop
--- End code ---

Actually colors don't work in code format, but you see where it says [color].

Navigation

[0] Message Index

[*] Previous page

Go to full version