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 new practice exercise sieve #665

Merged
merged 4 commits into from
Mar 27, 2024
Merged

Add new practice exercise sieve #665

merged 4 commits into from
Mar 27, 2024

Conversation

jiegillet
Copy link
Contributor

@jiegillet jiegillet commented Mar 9, 2024

It's been a while since I've implemented an exercise :)
This one will be featured on week 11 of 48in24.

This exercise is deceptively complex, because you are supposed to find prime numbers without the use of the division or modulo operator. It's very easy to solve otherwise, but then it wouldn't be the Sieve of Eratosthenes, so it will require an Elixir Analyzer rule, which I will work on next (EDIT: here).

Copy link
Contributor

@ceddlyburge ceddlyburge left a comment

Choose a reason for hiding this comment

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

I haven't tried to solve it (and not sure I want to!) but all the changes look good.

@@ -20,7 +20,7 @@ echo "Fetching latest version of configlet..."
echo "Adding instructions and configuration files..."
UUID=$(bin/configlet uuid)
jq --arg slug "$SLUG" --arg uuid "$UUID" \
'.exercises.practice += [{slug: $slug, name: $slug, uuid: $uuid, practices: [], prerequisites: [], difficulty: 5}]' \
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this to avoid a casing type problem with the title of the exercise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, it's too easy to miss when the name is prefilled, it happened a lot that people didn't change it (me included). At least with a big TODO you can't miss it (hopefully).

exercises/practice/sieve/.meta/src/Sieve.example.elm Outdated Show resolved Hide resolved
@jiegillet
Copy link
Contributor Author

Let's merge this when the rule is merged (or week 11 is about to start)

@jiegillet jiegillet mentioned this pull request Mar 27, 2024
@jiegillet jiegillet merged commit 3975515 into main Mar 27, 2024
6 checks passed
@jiegillet jiegillet deleted the jie-sieve branch March 27, 2024 10:05
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