mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
refactor(ai): rename holes -> count_holes
This commit is contained in:
parent
5c0d07ba15
commit
32d4e69d58
@ -1,6 +1,6 @@
|
|||||||
from .bumpiness import bumpiness
|
from .bumpiness import bumpiness
|
||||||
from .height import aggregate_height
|
from .height import aggregate_height
|
||||||
from .holes import holes
|
from .holes import count_holes
|
||||||
from .lines import complete_lines
|
from .lines import complete_lines
|
||||||
|
|
||||||
__all__ = ["aggregate_height", "bumpiness", "complete_lines", "holes"]
|
__all__ = ["aggregate_height", "bumpiness", "complete_lines", "count_holes"]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
def holes(
|
def count_holes(
|
||||||
field: np.ndarray[int, np.dtype[np.uint8]],
|
field: np.ndarray[int, np.dtype[np.uint8]],
|
||||||
) -> int:
|
) -> int:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from ai.heuristics import aggregate_height, bumpiness, complete_lines, holes
|
from ai.heuristics import aggregate_height, bumpiness, complete_lines, count_holes
|
||||||
|
|
||||||
|
|
||||||
class TestHeuristics(unittest.TestCase):
|
class TestHeuristics(unittest.TestCase):
|
||||||
@ -24,7 +24,7 @@ class TestHeuristics(unittest.TestCase):
|
|||||||
self.assertEqual(complete_lines(self.field), 2)
|
self.assertEqual(complete_lines(self.field), 2)
|
||||||
|
|
||||||
def test_holes(self) -> None:
|
def test_holes(self) -> None:
|
||||||
self.assertEqual(holes(self.field), 2)
|
self.assertEqual(count_holes(self.field), 2)
|
||||||
|
|
||||||
def test_bumpiness(self) -> None:
|
def test_bumpiness(self) -> None:
|
||||||
self.assertEqual(bumpiness(self.field), 6)
|
self.assertEqual(bumpiness(self.field), 6)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user