exercism-elixir/pacman-rules/HINTS.md
2022-01-31 09:28:22 -04:00

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/2 to 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/2 to 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/2 and not/1 to 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/2 and not/1 to combine the arguments and results of invoked functions.