Bots and Simulations > The Gene depository
Handy Genes
Endy:
Here is my little contributation. Value freezing using inc/dec. This technique allows you to "freeze" values or to raise or lower a number to a value and then freeze it.
This is best used for when you need a value at a constant number, but without the cost of continously storring it.
' Basic method to demonstrate
' Will keep .tieloc at -1 permanently
cond
start
.tieloc *.tieloc *.tieloc div mult inc
.tieloc dec
stop
' More complex method demonstrates freezing
' at a value with .ploc=7
cond
start
' When *.ploc = 7 dec by 1
.ploc *.ploc 7 sub 1000 mult add dec
.ploc inc
stop
Primarily these are for use with SG's but I'm sure you all can find other uses for them. Unfortunantly some of the more desirable values (shoot, .tieval, up) don't allow this, so you may have to do some searching for the ones that do.
Feel free to post your own finds here. Eventually any bot posted is fair game, so the real challenge is in the use of these codes to build a true top bot.
Endy ;)
Anonomous Guest Person:
More specifically, it doesn't work for any memory location between 1 and 8.
Or memory locations above 1000, but that's less of an evil rule that's needed to make sure bots need to expend SOME energy and more of a safeguard.
Botsareus:
A.G.P. SO?
Anonomous Guest Person:
That's rather important knowledge.
That is, knowing that one can not inc or dec the system variables 1-8.
Which means that DOES work for .tieval.
Botsareus:
ic
Navigation
[0] Message Index
[#] Next page
Go to full version