mirror of
https://github.com/rjNemo/exercism-elixir
synced 2026-06-06 02:16:48 +00:00
2.4 KiB
2.4 KiB
Hints
General
- Don't worry about how the arguments are derived, just focus on combining the arguments to return the intended result.
1. Define if pac-man can eat a ghost
- You need to define a named function with 2 arguments. The first argument is a boolean value, whether pac-man has a power pellet active. The second argument is a boolean value, whether pac-man is touching a ghost.
- The function must return a boolean value.
- You can use the boolean operator
and/2to combine the arguments for a result.
2. Define if pac-man scores
- You need to define a named function with 2 arguments. The first argument is a boolean value, whether pac-man is touching a power pellet. The second argument is a boolean value, whether pac-man is touching a dot.
- The function must return a boolean value.
- You can use the boolean operator
or/2to combine the arguments for a result.
3. Define if pac-man loses
- You need to define a named function with 2 arguments. The first argument is a boolean value, whether pac-man has a power pellet active. The second argument is a boolean value, whether pac-man is touching a ghost.
- The function must return a boolean value.
- You can use the boolean operators
and/2andnot/1to combine the arguments for a result.
4. Define if pac-man wins
- You need to define a named function with 3 arguments. The second argument is a boolean value, whether pac-man has eaten all of the dots. The first argument is a boolean value, whether pac-man has a power pellet active. The second argument is a boolean value, whether pac-man is touching a ghost.
- The function must return a boolean value.
- You can use the boolean operators
and/2andnot/1to combine the arguments and results of invoked functions.