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 strain exercise (#297) #306

Merged
merged 6 commits into from
Oct 31, 2023
Merged

Conversation

Adrien-LUDWIG
Copy link
Contributor

Are these two lambda acceptable? These are the predicates given to the tested function.
For the latter, is it ok to use list in this case? The lambda doesn't work with the quote form.

     (test-equal? "keeps strings"
                  (keep '("apple" "zebra" "banana" "zombies" "cherimoya" "zealot")
                        (lambda (x) (equal? (string-ref x 0) #\z)))
                  '("zebra" "zombies" "zealot"))

     (test-equal? "keeps lists"
                  (keep (list '(1 2 3) '(5 5 5) '(5 1 2) '(2 1 2) '(1 5 2) '(2 2 1) '(1 2 5))
                        (lambda (x) (if (member 5 x) #t #f)))
                  (list '(5 5 5) '(5 1 2) '(1 5 2) '(1 2 5)))

@github-actions
Copy link

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Oct 30, 2023
@Adrien-LUDWIG
Copy link
Contributor Author

@BNAndras

It's a ping again. 😅

exercises/practice/strain/strain-test.rkt Outdated Show resolved Hide resolved
exercises/practice/strain/strain.rkt Outdated Show resolved Hide resolved
@Adrien-LUDWIG
Copy link
Contributor Author

Oh wow, sorry. It's not very DRY. I will fix these right now.

@Adrien-LUDWIG Adrien-LUDWIG changed the title Add strain exercise Add strain exercise (#297) Oct 30, 2023
@Adrien-LUDWIG
Copy link
Contributor Author

It's cleaned.

Thank you for the time and effort you put into these reviews! 🚀

@BNAndras BNAndras merged commit 79ff1db into exercism:main Oct 31, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:module/practice-exercise Work on Practice Exercises
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants