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

Throws exception on first run #10

Closed jgrigonis closed 14 years ago

jgrigonis commented 14 years ago

You need these two lines at line 61 and 62:

    minds_str = str(config.get('minds', 'minds'))
    mind_list = [get_mind(n) for n in minds_str.split(',')]

Otherwise, you get an exception when the default.cfg is missing. Here's the exception:

Traceback (most recent call last): File "cells.py", line 526, in main() File "cells.py", line 70, in main print mind_list NameError: global name 'mind_list' is not defined

jgrigonis commented 14 years ago

Sorry, this is the exception:

Traceback (most recent call last): File "cells.py", line 528, in game = Game(bounds, mind_list, symmetric, -1) NameError: global name 'mind_list' is not defined

exupero commented 14 years ago

Is this issue still open? I haven't had this trouble and I see the code mentioned above in the source.

jgrigonis commented 14 years ago

It needs to be in there twice (yuck). Both in the try and except. It only throws the exception when default.cfg doesn't exist yet.

phreeza commented 14 years ago

I ended up moving the mind_list generation out of the try..except. should work now