feat(game): add move_right

This commit is contained in:
Kristofers Solo 2024-01-03 18:09:53 +02:00
parent 9e073c5bea
commit 6343445add

View File

@ -59,8 +59,14 @@ class Game2048:
def move_left(self) -> None:
pass
def move_right(self) -> None:
pass
def move_right(self) -> tuple[bool, int]:
self.board, has_pushed = self._push_board_right()
has_merged = self.merge()
self.board, _ = self._push_board_right()
move_made = has_pushed or has_merged
if move_made:
self.add_random_tile()
return move_made, self.score
def move_up(self) -> None:
pass