phreeza / cells

a game where players programm agents that compete for resources in a simulated environment
http://phonons.wordpress.com/2010/06/01/cells-a-massively-multi-agent-python-programming-game/
MIT License
222 stars 42 forks source link

I got an IndexError, but it's hard to reproduce #4

Closed jgrigonis closed 14 years ago

jgrigonis commented 14 years ago

Traceback (most recent call last): File "cells.py", line 471, in game = Game() File "cells.py", line 113, in init self.agent_map.insert(self.agent_population) File "cells.py", line 301, in insert self.set(o.x, o.y, o) File "cells.py", line 245, in set self.values[x,y] = val IndexError: index (300) out of range (0<=index<300) in dimension 1

swolchok commented 14 years ago

This probably happens when plants are generated at the edge of the map.

phreeza commented 14 years ago

I have added a tentative fix that places the plants 1 away from the edge. I'll close the issue for now.