added async stone detection thread

This commit is contained in:
2023-07-24 10:14:41 +02:00
parent 50ab6e17ef
commit a21f43fcfc
2 changed files with 16 additions and 7 deletions

View File

@@ -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