added async stone detection thread
This commit is contained in:
11
field.py
11
field.py
@@ -22,9 +22,18 @@ class Field():
|
||||
'{:2d} |'.format(i) + ' '.join(row) + '|'
|
||||
for i, row in enumerate(self.state)]) + '\n' + BAR
|
||||
|
||||
def rotate_90_degree_clckwise(matrix):
|
||||
new_matrix = []
|
||||
for i in range(len(matrix[0])):
|
||||
li = list(map(lambda x: x[i], matrix))
|
||||
li.reverse()
|
||||
new_matrix.append(li)
|
||||
|
||||
return new_matrix
|
||||
|
||||
def rotate_state(self):
|
||||
self.state = list(zip(*self.state[::-1]))
|
||||
self.state = self.rotate_90_degree_clckwise(self.state)
|
||||
print(self.state)
|
||||
|
||||
def get_line_count(self):
|
||||
return self.cleared_rows
|
||||
|
||||
Reference in New Issue
Block a user