feat(ai): add get_holes

This commit is contained in:
Kristofers Solo
2024-01-05 18:38:50 +02:00
parent 0d4ab8aab7
commit 8283742b62
2 changed files with 31 additions and 0 deletions

View File

@@ -48,3 +48,12 @@ class TestFitness(unittest.TestCase):
answers = (5, 0, 4)
for field, answer in zip(self.fields, answers):
self.assertEqual(get_bumpiness(None, field), answer)
def test_get_holes(self):
answers = (
np.array([1, 1, 0, 1, 2]),
np.array([0, 0, 0, 0, 0]),
np.array([0, 1, 0, 0, 0]),
)
for field, answer in zip(self.fields, answers):
self.assertTrue(np.array_equal(get_holes(field), answer))