Skip to content

Commit

Permalink
feat: add winner face
Browse files Browse the repository at this point in the history
Close #2
  • Loading branch information
AiroPi committed Jan 13, 2025
1 parent 4666110 commit 91966d3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/src/routers/minesweeper_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
CLOSED = load_image(BASE_PATH / "closed.png")
FACE = load_image(BASE_PATH / "face.png")
FACE_LOSE = load_image(BASE_PATH / "face_lose.png")
FACE_WIN = load_image(BASE_PATH / "face_win.png")

DIGITS = {i: load_image(BASE_PATH / f"{i}.png") for i in range(9)}

Expand All @@ -45,10 +46,13 @@ def get_img(text: str):
else:
return png_response(DEACTIVATED_FLAG)
case "face":
if game.game_over:
return png_response(FACE_LOSE)
else:
return png_response(FACE)
match game.state:
case minesweeper.GameState.LOST:
return png_response(FACE_LOSE)
case minesweeper.GameState.WON:
return png_response(FACE_WIN)
case _:
return png_response(FACE)
case _:
return 404

Expand Down

0 comments on commit 91966d3

Please sign in to comment.