Julio Biason
3 years ago
1 changed files with 4 additions and 4 deletions
@ -1,17 +1,17 @@ |
|||||||
defmodule Rules do |
defmodule Rules do |
||||||
def eat_ghost?(power_pellet_active, touching_ghost) do |
def eat_ghost?(power_pellet_active, touching_ghost) do |
||||||
power_pellet_active && touching_ghost |
power_pellet_active and touching_ghost |
||||||
end |
end |
||||||
|
|
||||||
def score?(touching_power_pellet, touching_dot) do |
def score?(touching_power_pellet, touching_dot) do |
||||||
touching_power_pellet || touching_dot |
touching_power_pellet or touching_dot |
||||||
end |
end |
||||||
|
|
||||||
def lose?(power_pellet_active, touching_ghost) do |
def lose?(power_pellet_active, touching_ghost) do |
||||||
! power_pellet_active && touching_ghost |
not power_pellet_active and touching_ghost |
||||||
end |
end |
||||||
|
|
||||||
def win?(has_eaten_all_dots, power_pellet_active, touching_ghost) do |
def win?(has_eaten_all_dots, power_pellet_active, touching_ghost) do |
||||||
has_eaten_all_dots && ! lose?(power_pellet_active, touching_ghost) |
has_eaten_all_dots and not lose?(power_pellet_active, touching_ghost) |
||||||
end |
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue