-
-
Notifications
You must be signed in to change notification settings - Fork 25
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(secret-handshake): overhaul to use enum #537
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This exercise has always [1] required the user to return seq[string], but the scenario is better modelled with an enum. This commit is similar to previous overhauls for the allergies [2] and space-age [3] exercises. Closes: exercism#536 [1] 8015636, 2019-02-24, "Adds secret-handshake exercise" [2] a8ab9c8, 2023-01-11, "exercises(allergies): overhaul to use enum" [3] b770d96, 2023-01-11, "exercises(space-age): overhaul to use enum"
ee7
force-pushed
the
exercise-secret-handshake-enum
branch
from
September 23, 2023 15:46
ed49d49
to
07098a6
Compare
ynfle
reviewed
Oct 2, 2023
ynfle
reviewed
Oct 2, 2023
Similar to previous discussions [1] I probably have a small preference for using shifts here, but it's fine either way. Note that bitops2 calls this `getBit` [2]. [1] exercism#434 (comment) [2] https://github.com/status-im/nim-stew/blob/3159137d9a31/stew/bitops2.nim#L420-L424 Suggested-by: ynfle
This better supports adding new enum values, as long as those values aren't "special" like Reverse.
For symmetry with the branch above.
ynfle
approved these changes
Oct 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This exercise has always (8015636) required the user to return
seq[string]
, but the scenario is better modelled with an enum.This PR is similar to previous overhauls for allergies (a8ab9c8) and space-age (b770d96).
Closes: #536
To-do:
Signal
toAction
, to better match the docs. An argument forSignal
is that it allows the user to more cleanly addReverse
, which isn't exactly an "action".