~piotr-machura/sweep-ai

d3924e6f9c963807d1bef6f81de37fd35a8488bd — Piotr Machura 10 months ago 2d45d6c
Formatting change
3 files changed, 10 insertions(+), 4 deletions(-)

M poetry.lock
M sweep_ai/__main__.py
M tests/test_logic.py
M poetry.lock => poetry.lock +2 -2
@@ 310,8 310,8 @@ python-versions = "*"

[metadata]
lock-version = "1.1"
python-versions = "3.8"
content-hash = "6d02df6b55ba87f647d238f9368d8b8a8b66076fd3aec616a4ed8eeca10f96c6"
python-versions = "^3.8"
content-hash = "407fef3877e7378df4c4f6f446bbd3a35fd646ef1aed2c4b8f946302a723a33d"

[metadata.files]
astroid = [

M sweep_ai/__main__.py => sweep_ai/__main__.py +3 -1
@@ 3,7 3,9 @@ from .logic import State


def main():
    State(4, 0.25)
    """Entrypoint function."""
    state = State(4, 0.25)
    state.click(0, 0)


if __name__ == '__main__':

M tests/test_logic.py => tests/test_logic.py +5 -1
@@ 23,7 23,11 @@ def test_bombs():
            [1, 1, 0, 1],
        ]))

    for size, percentage in [(4, 0.25), (10, 0.1), (12, 0.34), (20, 0.1),]:
    for size, percentage in [
        (4, 0.25),
        (10, 0.1),
        (12, 0.34),
    ]:
        state = logic.State(size, percentage)
        assert np.sum(state.bomb) == round(size**2 * percentage)