about summary refs log tree commit diff
path: root/bots/warrior0.asm
diff options
context:
space:
mode:
authorSven M. Hallberg <pesco@khjk.org>2023-04-10 20:07:22 +0200
committerSven M. Hallberg <pesco@khjk.org>2023-04-10 20:07:22 +0200
commitaaf716b690b23fcde0bccaf8d0a6afb1bd7b5cf5 (patch)
treedba21a9946e6ab4906c4216cf8c62fe60f4e2ce7 /bots/warrior0.asm
parent7cc6f9372271cd6c19af5d8d3c8a459495f3e196 (diff)
place bots fairly
The trick is to consider not the final offsets at first, but the
places between the free bytes. Select one for each bot uniformly
at random; a heap is an appropriate data structure to store them.
Pick a random permuation for the order of the bots and iterate over
the positions from start to end. Compute the eventual offsets by
adding to each the amount of space allocated so far.

Thus we obtain any possible placement all over the available memory
without bias.
Diffstat (limited to 'bots/warrior0.asm')
0 files changed, 0 insertions, 0 deletions