__matmul__
This commit is contained in:
parent
578b126b3e
commit
fe93336bb9
@ -262,7 +262,7 @@ class TetrisLogic:
|
|||||||
|
|
||||||
def rotate(self, spin):
|
def rotate(self, spin):
|
||||||
rotated_coords = tuple(
|
rotated_coords = tuple(
|
||||||
mino.coord.rotate(spin)
|
mino.coord @ spin
|
||||||
for mino in self.matrix.piece
|
for mino in self.matrix.piece
|
||||||
)
|
)
|
||||||
for rotation_point, liberty_degree in enumerate(
|
for rotation_point, liberty_degree in enumerate(
|
||||||
|
@ -7,7 +7,7 @@ class Coord:
|
|||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
return Coord(self.x + other.x, self.y + other.y)
|
return Coord(self.x + other.x, self.y + other.y)
|
||||||
|
|
||||||
def rotate(self, spin):
|
def __matmul__(self, spin):
|
||||||
return Coord(spin * self.y, -spin * self.x)
|
return Coord(spin * self.y, -spin * self.x)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user