Quellcode für gropro.operation

from abc import ABC, abstractmethod

from gropro.element import Element


class IOperation(ABC):
    @abstractmethod
    def act(self, el: list[int]) -> list[int]: ...


[Doku] class Invert(IOperation):
[Doku] def act(self, el: list[int]) -> list[int]: return [Element.flip(e) for e in el]
[Doku] class Rotate(IOperation):
[Doku] def act(self, el: list[int]) -> list[int]: return list(reversed(el))