mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
refactor(ai): rename bumpiness -> get_bumpiness
This commit is contained in:
parent
32d4e69d58
commit
9c4b697722
@ -1,6 +1,6 @@
|
|||||||
from .bumpiness import bumpiness
|
from .bumpiness import get_bumpiness
|
||||||
from .height import aggregate_height
|
from .height import aggregate_height
|
||||||
from .holes import count_holes
|
from .holes import count_holes
|
||||||
from .lines import complete_lines
|
from .lines import complete_lines
|
||||||
|
|
||||||
__all__ = ["aggregate_height", "bumpiness", "complete_lines", "count_holes"]
|
__all__ = ["aggregate_height", "get_bumpiness", "complete_lines", "count_holes"]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
def bumpiness(
|
def get_bumpiness(
|
||||||
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, count_holes
|
from ai.heuristics import aggregate_height, complete_lines, count_holes, get_bumpiness
|
||||||
|
|
||||||
|
|
||||||
class TestHeuristics(unittest.TestCase):
|
class TestHeuristics(unittest.TestCase):
|
||||||
@ -27,4 +27,4 @@ class TestHeuristics(unittest.TestCase):
|
|||||||
self.assertEqual(count_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(get_bumpiness(self.field), 6)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user