exercism/elixir/rpg-character-sheet/HINTS.md

2.6 KiB

Hints

General

1. Welcome the new player

2. Ask for the character's name

  • There is a built-in function that reads a string from the standard output. It can also write a prompt, so there is no need to use a separate function to write the question.
  • There is a build-in function in the String module that can remove trailing and leading whitespace from the input.

3. Ask for the character's class

  • There is a built-in function that reads a string from the standard output. It can also write a prompt, so there is no need to use a separate function to write the question.
  • There is a build-in function in the String module that can remove trailing and leading whitespace from the input.

4. Ask for the character's level

  • There is a built-in function that reads a string from the standard output. It can also write a prompt, so there is no need to use a separate function to write the question.
  • There is a build-in function in the String module that can remove trailing and leading whitespace from the input.
  • There is a build-in function in the String module that can convert a string to an integer.

5. Combine previous steps into one

  • Reuse functions implemented in previous steps.
  • There is a built-in function, useful for debugging, that can write to the standard output more than just strings. That functions accepts options, for example a string that will be written before the passed value.
  • The function and its option mentioned above will append a colon and a space to that string for you.