diff --git a/task5/main.py b/task5/main.py index a39a448..05bc09d 100644 --- a/task5/main.py +++ b/task5/main.py @@ -18,7 +18,7 @@ mice: list[int] = [i for i in range(grey + white)] eaten: list[int] = [] current_mouse = 0 while len(mice) > total_remaining: - current_mouse: int = (current_mouse + S) % len(mice) + current_mouse = (current_mouse + S) % len(mice) eaten.append(mice[current_mouse]) mice.pop(current_mouse) @@ -36,6 +36,6 @@ for i in range(white - white_remaining): pattern[eaten.pop(0)] = Mouse.white if len([a for a in pattern if a == Mouse.grey]) != grey or pattern[0] != Mouse.grey: - raise ValueError(f"Невозможный исход: {" ".join(map(lambda x: str(x.value), pattern))}") + raise ValueError(f"Невозможный исход: {" ".join(str(mouse.value) for mouse in pattern)}") -print(*map(lambda x: x.value, pattern)) +print(*(str(mouse.value) for mouse in pattern))