Skip to content

New practice exercise zebra-puzzle #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
angelikatyborska opened this issue May 1, 2021 · 2 comments
Closed

New practice exercise zebra-puzzle #723

angelikatyborska opened this issue May 1, 2021 · 2 comments

Comments

@angelikatyborska
Copy link
Member

angelikatyborska commented May 1, 2021

New practice exercise zebra-puzzle

Implement the zebra-puzzle practice Exercise in the Elixir track as it is defined in: problem-specifications/exercises/zebra-puzzle

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 from canonial-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.

More about this config.

Stuck? Questions?

Do not hesitate to tag @angelikatyborska (me) and ask for help.

@angelikatyborska
Copy link
Member Author

Example implementations:

jiegillet added a commit to jiegillet/elixir that referenced this issue Jun 9, 2021
angelikatyborska pushed a commit that referenced this issue Jun 11, 2021
* [#723] New practice exercise `zebra-puzzle`

Add solution

Add config file

* Fix typos

* Swap keyword-lists for maps

* Fix formatting

* Fix warnings
@angelikatyborska
Copy link
Member Author

Closed via #753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant