[erlang-questions] write the ant simulation in Erlang?
Fri Oct 10 02:57:07 CEST 2008
2008/10/10 Richard O'Keefe <>
> On 10 Oct 2008, at 10:47 am, Robert Virding wrote:
>> A first approximation would be to have one process per ant and one for the
>> world. The only problem would be handling atomic
> Thinking idly about this last night, I wondered whether
> the look at the world bit *should* be atomic. Real ants
> don't lock the real world, and while an ant is looking at
> one square, something _could_ move into a square it can't
This was to get around the problem of checking if a cell was free before
moving into and then finding the cell has been taken. The immediate world is
one cell left, center, right, so it is very immediate. The "spec" stated
only one ant per cell.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions