mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2026-03-22 00:36:20 +00:00
feat(ai): add get_wells
This commit is contained in:
@@ -8,6 +8,7 @@ from ai.fitness.transitions import (
|
||||
get_col_transition,
|
||||
get_row_transition,
|
||||
)
|
||||
from ai.fitness.wells import get_wells
|
||||
|
||||
|
||||
class TestFitness(unittest.TestCase):
|
||||
@@ -58,3 +59,12 @@ class TestFitness(unittest.TestCase):
|
||||
)
|
||||
for field, answer in zip(self.fields, answers):
|
||||
self.assertTrue(np.array_equal(get_holes(field), answer))
|
||||
|
||||
def test_get_wells(self):
|
||||
answers = (
|
||||
np.array([1, 0, 2, 1, 0]),
|
||||
np.array([0, 0, 0, 0, 0]),
|
||||
np.array([2, 0, 2, 0, 0]),
|
||||
)
|
||||
for field, answer in zip(self.fields, answers):
|
||||
self.assertTrue(np.array_equal(get_wells(field=field), answer))
|
||||
|
||||
Reference in New Issue
Block a user