Skip to content
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

zebra-puzzle: add canonical data #947

Merged
merged 3 commits into from
Oct 26, 2017

Conversation

HarrisonMc555
Copy link
Contributor

@HarrisonMc555 HarrisonMc555 commented Oct 12, 2017

Closes #592

There isn't much to do on this one since there's only one static answer. But I figured I would include it for completeness.

@Insti
Copy link
Contributor

Insti commented Oct 12, 2017

Comment not directly related to the PR:

This exercise does not seem like a good Exercism problem.

@ErikSchierboom
Copy link
Member

@Insti Test-wise it is indeed not a great fit, although the problem itself is brilliant, as it forces you to prune a rather large search space. I've seen lots of interesting submissions.

I think we could perhaps improve this exercise by adding intermediate tests for some of the properties that should hold.

"cases": [
{
"description": "resident who drinks water",
"property": "nationality",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the properties be: 'drinks_water' and 'owns_zebra' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that this would be the return "type" of the expected value. If we do adjust the exercise to use different clues, then this would be a good way to know what data "type" the exercise would be testing for. Or would this not be a good use of the "property" tag? We could alternatively use "nationality", etc. as the key instead of "expected".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we're always asking for nationality. How does the test generator know whose nationality we want?

If the exercise changes, the test data will also need to change so I would not worry about future proofing at this stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I understand now. And yes, good point. Changing now.

@Insti
Copy link
Contributor

Insti commented Oct 12, 2017

@Insti Test-wise it is indeed not a great fit, although the problem itself is brilliant, as it forces you to prune a rather large search space. I've seen lots of interesting submissions.

I must admit that I've not tried to solve it myself.

Would it be possible to formulate a (or n) different set(s) of clues that the same solver could use in order to have test cases that couldn't be passed just by returning static values?

@ErikSchierboom
Copy link
Member

Good question. I have to think about it.

@HarrisonMc555
Copy link
Contributor Author

I don't believe I have write access to this repository, so I can't merge this. Does somebody want to merge for me? Thanks 😄

@HarrisonMc555
Copy link
Contributor Author

Let me know if you want me to squash or if you want to do a squash on merge.

@jpreese
Copy link
Contributor

jpreese commented Oct 26, 2017

You're all set @HarrisonMc555

@jpreese jpreese merged commit 16f6dbc into exercism:master Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants