TetrisAI / utils.py
marci0929's picture
Upload with huggingface_hub
13bec41
raw
history blame contribute delete
No virus
335 Bytes
def calc_holes_array(self, board, heights):
holes_list = []
for col_num in range(self.width):
col_value = 0
for row_num in range(self.height - 1, self.height - 1 - heights[col_num], -1):
col_value += 0 if board[row_num][col_num] == 1 else 1
holes_list.append(col_value)
return holes_list