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

exercises(raindrops): implement #155

Merged
merged 5 commits into from
Aug 3, 2023
Merged

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Feb 8, 2023

To-do:

  • config.json: practices / prerequisites

@ee7 ee7 changed the title exercises: add raindrops exercises(raindrops): implement Feb 24, 2023
@ee7 ee7 force-pushed the exercises-add-raindrops branch 2 times, most recently from a6e0bb8 to 516a2f7 Compare February 26, 2023 17:31
@ee7 ee7 marked this pull request as ready for review March 23, 2023 23:13
@ee7 ee7 requested a review from ErikSchierboom March 23, 2023 23:14
@ee7 ee7 self-assigned this Mar 28, 2023
@rofrol
Copy link

rofrol commented May 13, 2023

Is the solution correct? Or testing?

I think either we

  1. pass allocator
  2. pass buffer but expect length returned. Like here in section "Passing the slice as a parameter" https://blog.orhun.dev/zig-bits-01/

ee7 added 4 commits August 3, 2023 20:57
Use the variable name that we use in the tests, and other exercises.
Make it more reasonable to add a test for a large number later, and make
the required buffer size more obvious (the maximum value of a usize on a
64-bit platform has 20 digits).
Not currently consequential.
@ee7
Copy link
Member Author

ee7 commented Aug 3, 2023

Is the solution correct? Or testing?

@rofrol Hey. Thanks for the comment, and sorry for the slow reply. The example solution here isn't returning a pointer to stack-allocated memory, if that's what you mean.

But it's not critically important that the example solution in this repo is the most idiomatic one, partly because the example solution isn't user-facing. The important thing is that the example solution passes the tests, and that the tests are such that it's possible to write a reasonably idiomatic solution (or ideally, a range of reasonable solutions, so that there's scope for discussing the tradeoffs of various approaches). Please yell at me if you think the tests don't allow that.

And let's go without an allocator for this exercise. We'll have enough exercises that use an allocator, and in this one, we always know the maximum memory required at the call site.

@ee7 ee7 merged commit d1b8784 into exercism:main Aug 3, 2023
5 checks passed
@ee7 ee7 deleted the exercises-add-raindrops branch August 3, 2023 20:09
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