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

Add collatz-conjecture exercise #10

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

ageron
Copy link
Contributor

@ageron ageron commented Aug 24, 2024

Note: I've excluded the test cases for zero or negative inputs.

@ageron ageron merged commit 2e6951e into exercism:main Aug 24, 2024
2 checks passed
@ageron ageron deleted the add-collatz-conjecture branch August 24, 2024 20:26
@Anton-4
Copy link
Contributor

Anton-4 commented Aug 26, 2024

Note: I've excluded the test cases for zero or negative inputs.

How are these handled for other languages?

@ageron
Copy link
Contributor Author

ageron commented Aug 26, 2024

Some include them, some don't. I initially didn't know what to do with them, so I left them out, but in recent exercises I've adapted the test cases to make them more idiomatic for Roc, i.e., I've use result == Ok 123 and result == Err "some error message.".
Would it be even more idiomatic to use tags instead of strings? E.g., result == Err InvalidNegativeInput or something?

@ageron
Copy link
Contributor Author

ageron commented Aug 26, 2024

I'll update this exercise to add the error handling test cases.

@ageron
Copy link
Contributor Author

ageron commented Aug 27, 2024

@Anton-4 , I updated the code to add error handling (see #33), thanks for your feedback.

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.

2 participants