Skip to content

Commit 4145b6a

Browse files
authored
Update arcade_game.py
1 parent 4758e9a commit 4145b6a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

exercises/concept/ghost-gobble-arcade-game/arcade_game.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def eat_ghost(power_pellet_active, touching_ghost):
99
:return: bool - can a ghost be eaten?
1010
"""
1111

12-
pass
12+
return power_pellet_active and touching_ghost
1313

1414

1515
def score(touching_power_pellet, touching_dot):
@@ -19,8 +19,8 @@ def score(touching_power_pellet, touching_dot):
1919
:param touching_dot: bool - is the player touching a dot?
2020
:return: bool - has the player scored or not?
2121
"""
22-
23-
pass
22+
return touching_power_pellet or touching_dot
23+
2424

2525

2626
def lose(power_pellet_active, touching_ghost):
@@ -30,8 +30,8 @@ def lose(power_pellet_active, touching_ghost):
3030
:param touching_ghost: bool - is the player touching a ghost?
3131
:return: bool - has the player lost the game?
3232
"""
33-
34-
pass
33+
return touching_ghost and not power_pellet_active
34+
3535

3636

3737
def win(has_eaten_all_dots, power_pellet_active, touching_ghost):
@@ -43,4 +43,4 @@ def win(has_eaten_all_dots, power_pellet_active, touching_ghost):
4343
:return: bool - has the player won the game?
4444
"""
4545

46-
pass
46+
return has_eaten_all_dots and touching_ghost and not power_pellet_active

0 commit comments

Comments
 (0)