mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
feat(ai): add complete_lines
This commit is contained in:
parent
00da10e482
commit
5c0d07ba15
@ -2,4 +2,13 @@ import numpy as np
|
||||
|
||||
|
||||
def complete_lines(field: np.ndarray[int, np.dtype[np.uint8]]) -> int:
|
||||
return 0
|
||||
"""
|
||||
Calculates the number of complete lines in the field.
|
||||
|
||||
Args:
|
||||
field: 2D array representing the game field.
|
||||
|
||||
Returns:
|
||||
The number of complete lines in the field.
|
||||
"""
|
||||
return int(np.sum(np.all(field, axis=1)))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user