feat(ai): add aggregate_height

This commit is contained in:
Kristofers Solo 2024-01-09 20:28:31 +02:00
parent 89884d7e2a
commit 9daa4f6509

View File

@ -2,4 +2,13 @@ import numpy as np
def aggregate_height(field: np.ndarray[int, np.dtype[np.uint8]]) -> int:
return 0
"""
Calculates the aggregate height of the field.
Args:
field: 2D array representing the game field.
Returns:
The aggregate height of the field.
"""
return int(np.sum(field.shape[0] - np.argmax(field, axis=0)))