Closed meatball133 closed 6 months ago
@meatball133 do you have any ideas for what this would look like in Crystal? I looked at the canonical data and description of this a few months back and couldn't figure out how it would map to an exercise and I've also never run into this problem on another track.
As for the basic implementation, I am thinking of just 2 tests upp right from the canonical data, like the python's test file: https://github.com/exercism/python/blob/main/exercises/practice/zebra-puzzle/zebra_puzzle_test.py .
And then either a more functional approach like the pythons track solution, with 2 functions one for drink_water and one for owns_water. Another approach is using a more object oriented approach, like the javascript one: https://github.com/exercism/javascript/blob/main/exercises/practice/zebra-puzzle/zebra-puzzle.js
I am open for both of these approaches
So there's no test input and the expectation is that the student will encode the problem statement as part of their solution?
By looking at how other languages have implemented the problem so would I say yes.
I'd be happy to work on this one.
For #48in24, the Crystal track missing a few exercises, we would appreciate contributors to help out with implementing exercises.
✅ Getting started
Before you start, write a message in this issue that you like to claim the issue.
Docs
This doc do you have to read first, if you are a first-time contributor:
How to use the Crystal track generator General information about how to implement practice exercise
Here are some documents that might be useful (not mandatory to read):
Contributing to Exercism | Exercism and GitHub | - Contributor Pull Request Guide What are those Weird Task Tags about? Exercism Formatting and Style Guide Exercism Markdown Specification Reputation
Start
Fetch configlet by:
Then
Read problem spec canonical data, then look at already written
test_template.ecr
, which can be found under most practice exercises.meta
folder.Then write a template, to test if the template works you can just (this requires Crystal to be installed):
After that should the spec file be updated if not an error should have been raised which may or may not have to be solved. Then you just write a solution and put that in
.meta/src/example.cr
, then make a stub file insrc/<exercise_name>
. Then inconfig.json
of the exercise add your GitHub username and you just push and your pr is ready for review.Got stuck?
No problem, we are here to help, just drop a comment in the issue with what you need help with.