You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
At present snakes are spawned as a single segment in a randomly chosen cell. This is unfortunate because it means snakes will sometimes spawn on top of other snakes.
A naive solution is:
(1) Generate a random cell C
(2) Loop over all snakes, checking if they have C as a segment, and going back to (1) if so
This will loop infinitely if all cells are occupied. That will not always be possible under the rules, unless spawning into an existing game.
Come up with a decent solution for now.
The text was updated successfully, but these errors were encountered:
At present snakes are spawned as a single segment in a randomly chosen cell. This is unfortunate because it means snakes will sometimes spawn on top of other snakes.
A naive solution is:
This will loop infinitely if all cells are occupied. That will not always be possible under the rules, unless spawning into an existing game.
Come up with a decent solution for now.
The text was updated successfully, but these errors were encountered: