Code center > Suggestions
Variable length arrays for the bots
Numsgil:
This isn't as much an issue now, but playing around with the idea of bot IDs (as in "Bot 10456 attacked me. Everyone attack him if you see him!"), variable number of ties, and other similar issues having a "foreach" type loop in the DNA would be very useful. This only works if this "foreach" was performed on an array.
We could have, say, 10 circular arrays of unlimited length that bots can write to that persist across cycles just like memory locations, addressed by memory locations -1 through -10.
I haven't worked out all the specifics, but something like the following is my goal (in pseudocode)
if a bot is attacking me that's supposed to be a conspec:
store this ID in .Cheaters array
...
if I see another bot:
foreach ID in .Cheaters array, if other bot's ID = ID from .Cheaters array, attack this bot or run away.
Sprotiel:
I don't think it's a good idea. Most likely, there will be evolved bots that write to it every turn. Suppose there are 100 of them, living 10000 turns on average and that they use this foreach every turn. This means you get one million tests to perform every turn... A high price to pay for a dubious benefit!
Endy:
Maybe limit the array size to something smaller. I don't think that they need to have a completly unlimited storage potential, just be able to hold multiple values in a single location.
Numsgil:
Certainly not more than probably 100 locations. I'm imagining a case where bots want to do something to every tie, or every eye, etc.
EricL:
Several things.
First, I don't think we need invent new data structures such as new stacks or queues or arrays. I think it might be sufficient to simply add a new command or two which allowed for addressing and operating upon multiple existing memory locations at once. For example, lets invent the operator ** and say X Y ** means "memory locations X through X+Y inclusive.
Thus, we could do something like
cond
.eye1 9 ** 50 >
start
blah blah
end
The condition would be true if any eye value was greater than 50. I think this could be pretty easily implemented by pushing a magic value representing the ** command (or other such commands) onto the integer stack.
We could add other commands, for example **=, where X Y Z **= meant "the first memory location between X and X+Y inclusive where the value equals Z. Thus Num's could store the IDs of the "bad" bots in the genetic memory locations as
*.refID 971 20 0 **= store
and test for them as
*.refID 971 20 ** =
Second, I think we have to differentiate between operating upon multiple existing memory existing locations where the results are already defined, such as above and the need to expand the grammer into new territory such as operating on multiple ties at once where there isn't a paradym in place for addressing all ties at once. I would seperate the two issues as they may have different solutions. Things which are addressed via a level of indiretion through a single sysvar such as .tienum may require a slightly different mechansim.
Navigation
[0] Message Index
[#] Next page
Go to full version