I currently have a 2d array generated by this code:
for y in range(width):
self.grid.append([])
for x in range(width):
self.grid[y].append(Cell(x, y))
If I want to select a random cell, how would I go about it? random.choice doesn't seem to be working.
xvalue, a randomy, and your random cell will beself.grid[random_x][random_y]. You can userandom.randintorrandom.randrangeto do so.