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

Approaches for leap #330

Merged
merged 5 commits into from
Jan 17, 2024
Merged

Approaches for leap #330

merged 5 commits into from
Jan 17, 2024

Conversation

BNAndras
Copy link
Sponsor Member

No description provided.

@BNAndras BNAndras added x:action/create Work on something from scratch x:type/content Work on content (e.g. exercises, concepts) labels Jan 15, 2024
@BNAndras BNAndras marked this pull request as ready for review January 15, 2024 07:29
@glennj
Copy link

glennj commented Jan 15, 2024

Awesome job!

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

One small suggestion, but feel free to ignore and merge.

Comment on lines 16 to 24
[The match form][match-form] compares an expression to a series of patterns describing its shape.
For this exercise, this takes the form of creating a list containing three Boolean values representing whether a year is divisible by 4, 100, or 400.
The first three patterns describe a three-element list, but each one encodes a literal `#t` to be matched in a different location. The other elements can be any value due to `_`.
The first pattern accepts any value for the first two slots but requires `#t` in the third.
This means any year divisible by 400 will match this pattern regardless of whether it's also divisible by 4 or 100.
The second pattern accepts any value for the first and last slot but requires `#t` in the second slot.
This means any year that's divisible by 100 but not by 400 matches this pattern.
If it were divisible by 400, the first pattern would have matched.
The third pattern operates similarly, and finally any remaining value that didn't match the previous patterns will satisfy the last pattern.
Copy link
Member

Choose a reason for hiding this comment

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

My only suggestion would be to maybe copy-paste (part of) the pattern matching code in the description, to prevent students from having to scroll up for the code reference.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

I'll take care of that tonight. Thanks for the review.

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Lovely!

@BNAndras BNAndras merged commit f557817 into exercism:main Jan 17, 2024
7 checks passed
@BNAndras BNAndras deleted the add-leap-approaches branch January 17, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/create Work on something from scratch x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants