In this line of my program i want to revise the first line of my Matrix except the first and last values: f=line, c=column. i and c correspond the their adjoining coordenates.
mines_adj=0
elif f==0 and c!=(0 or self.num_columns):
for i in range(0,2,1):
for j in range(-1,2,1):
if self.matrix[int(f)+i][int(c)+j].set_mine(): #error list index out of range
mines_adj+=1
self.matrix[int(f)][int(c)].set_value(mines_adj)
Comments
Post a Comment