Description
New practice exercise pov
Implement the pov
practice Exercise in the Elixir track as it is defined in: problem-specifications/exercises/pov
How to implement a new practice exercise?
1. New mix project
Create a new mix project in exercises/practice/<exercise-slug>
and configure it in the same way as other exercises (with regard to Elixir version, .formatter.exs
, test/test_helper.exs
etc.).
2. Instructions
Copy description.md
from problem specifications into .docs/instructions.md
of the new exercise. Do not edit it.
What to do if you need to Elixir specific instructions.
3. Exercise config
Create .meta/config.json
. The fields blurb
, source
, and source_url
should be copied from problem specifications, from the file metadata.yml
.
More details about the exercise config.
Make sure to give yourself credit for being the author 💪.
4. Tests
Create a test suite.
- The test suite should implement all test cases as described in
canonical-data.json
in the problem specifications repository for this exercise. Remember that this file describes the exercise for all tracks. You will need to interpret in a way that makes sense for Elixir. - See instructions here about how to read
canonial-data.json
- Avoid omitting any test cases from
canonial-data.json
unless there is a good Elixir-specific reason to do so. - You can come up with more test cases than
canonial-data.json
describes, especially if there's something Elixir-specific that needs to be tested. - Create a
.meta/tests.toml
file that documents which tests fromcanonial-data.json
were implemented.
5. Example solution
Write an example solution in .meta/example.ex
. It needs to pass all tests added in the previous step. It doesn't have to be beautiful, it only has to prove that the Exercise can be solved.
6. Solution stub
Write a solution stub in lib/<exercise_name>.ex
. It should probably include empty function definitons for all the functions required by the test suite, each with a @doc
and a @spec
.
7. Optionally, document your decisions
If there is something unusual about this exercise, you can create a .meta/design.md
file and describe the problem there.
8. Add exercise to track config
Open up the file config.json
at the root of this repository. Find the list under the key exercises.practice
and add your new exercise at the end of that list. You will need to decide how difficult the exercise is on the scale from 1 to 9, but also which conepts must be known by the student to solve this exercise well. Leave this field empty if you're not sure. A track maintainer can help you with that.
Stuck? Questions?
Do not hesitate to tag @angelikatyborska (me) and ask for help.