7yl4r / LifeGenes

:jeans: genetic inheritance + Conway's Game of Life.
12 stars 1 forks source link

cell lookup is difficult #3

Closed 7yl4r closed 11 years ago

7yl4r commented 11 years ago

The only way to find the genome of a cell at a given location (a very common task) is to manually search through all cell.x and cell.y. We need a better way to do this. Sorting is an option, and so is creating a 2d array, but the easiest way would be to make the cells list a dict, and create a location string as the key. Thus one can just do cells['x,y'] or similar.