flappy init
This commit is contained in:
2
field.py
2
field.py
@@ -154,6 +154,8 @@ class Field():
|
|||||||
def predict_gaps_in_next_rotation(self):
|
def predict_gaps_in_next_rotation(self):
|
||||||
tmp_state = copy(self.state)
|
tmp_state = copy(self.state)
|
||||||
tmp_state = self.rotate_90_degree_anticlckwise(tmp_state)
|
tmp_state = self.rotate_90_degree_anticlckwise(tmp_state)
|
||||||
|
if tmp_state[9][0] is not ' ' and tmp_state[9][1] is not ' ':
|
||||||
|
return 10
|
||||||
for row in range(int(self.HEIGHT/2)):
|
for row in range(int(self.HEIGHT/2)):
|
||||||
tmp_state[row] = [' ' for cols in range(Field.WIDTH)]
|
tmp_state[row] = [' ' for cols in range(Field.WIDTH)]
|
||||||
return sum(
|
return sum(
|
||||||
|
|||||||
Reference in New Issue
Block a user