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

[FEAT]: Implement a prime checker script #104

Open
coxmars opened this issue Jan 22, 2025 · 12 comments · May be fixed by #117
Open

[FEAT]: Implement a prime checker script #104

coxmars opened this issue Jan 22, 2025 · 12 comments · May be fixed by #117
Assignees
Labels
cairo-scripts difficult: easy enhancement New feature or request ODBoost This issue will be available ONLY during the ODBoost

Comments

@coxmars
Copy link
Contributor

coxmars commented Jan 22, 2025

📘 Description

We need to implement a function that determines whether a given number is prime. A prime number is a natural number greater than 1 that is only divisible by 1 and itself. This implementation will be part of our mathematical utilities package.

✅ Acceptance Criteria

  • Create a function that accepts a positive integer as input
  • Return a boolean value: true if the number is prime, false otherwise
  • Handle edge cases properly (1, negative numbers, etc.)

🌎 References

📜 Additional Notes

  • Do not apply until the ODBoost begins.
  • Read our contribution guidelines before applying.
@coxmars coxmars added cairo-scripts enhancement New feature or request ODBoost This issue will be available ONLY during the ODBoost difficult: easy labels Jan 22, 2025
@petersdt
Copy link

petersdt commented Jan 22, 2025

I'm Pete, a frontend developer who enjoys building smooth and engaging websites using JavaScript, and frameworks. Am also experienced in working with smart contracts.
After observing Alexandria Math Package i will tackle the above task with the following steps:

  1. Function definition: function is_prime(n: integer) -> boolean:
  2. Handle edge case: Start by handling edge cases. Prime numbers are greater than 1, so I will check for numbers like 1 or negative numbers and return False.
  3. Handle Small Numbers: If the number is 2 or 3, return True because both are prime.
  4. Eliminate Even Numbers: Any even number greater than 2 is not prime, so return False if n is divisible by 2.
  5. Check divisibility: For odd numbers greater than 3, I will check divisibility from 3 up to the square root of the number.
  6. Return result: If a divisor without remender is found, return False. Otherwise, return True.

ETA <= 10hrs

@codebestia
Copy link

codebestia commented Jan 22, 2025

Can i work on this? @coxmars
I am a good blockchain developer with ample experience with cairo.

How i will handle this

  • I will fork this repo and follow the contribution guide.
  • I will use the alexandria Math is_prime package for this
  • I will create a cairo project called prime_checker in the cairo/scripts directory.
  • I will make sure to handle edge cases in the prime_checker function
  • I will make a PR within 24 hours of assignment.

@Nityam573
Copy link

Can I get assigned to this task @coxmars
I am proficient in cairo projects
View my Profile:
https://app.onlydust.com/u/Nityam573

@armaanansari121
Copy link

armaanansari121 commented Jan 22, 2025

May I take this up? I've been a Competitive Programmer, I'm specialist at codeforces and I'm also good at cairo. So this would be perfect issue for me.

ETA: 24 hrs

@Jagadeeshftw
Copy link

Proposal to Work on the Issue

I would be delighted to contribute to this issue, as I have extensive experience with Cairo programming and developing decentralized applications on StarkNet.

Estimated Timeline

I anticipate delivering a working solution within the next 24 hours. Please let me know if I can proceed.

Looking forward to contributing and collaborating!

Best regards,
Jagadeesh B

@ryzen-xp
Copy link

Hi,
I am proficient Blockchain developer expert in Cairo , Rust and Solidity and also in web development.
I have contributed many starknet project and more .
please /assign this issue .
Thank You !!

@savagechucks
Copy link

Hi.
This is my first issue.
May I take on this issue?

@Michaelkingsdev
Copy link

Let me try this one!

@GideonBature
Copy link
Contributor

May I handle this issue?

Would love to tackle this!

I am a Software Engineer with experience working with cairo. I will build a script that takes in any number, check if it is a prime number or not, and return a boolean depending on whether it is a prime number or not and also handle edge cases like 1 and negative numbers. I will send my first PR within 24 hrs if I am assigned this issue. Thank you!

Thank you!

@RomThpt
Copy link

RomThpt commented Jan 22, 2025

I’d love to work on this task and contribute to the project. I’ll be participating in the ETHDenver hackathon, and I see this as a great opportunity not only to help improve the project but also to grow my skills by tackling this issue.

@ShantelPeters
Copy link
Contributor

May I take this issue on?

@aguilar1x
Copy link
Contributor

Can I try solving this issue?

Hi, my name is Matías Aguilar. I am a software development engineer with 1 year of experience in backend and some frontend. I am a maintainer of projects like RevolutionaryFarmers and StarShop, focusing on Smart Contracts using Rust, and I also have experience with Cairo, I was creating contracts for a project integrated into the Winter Hackathon and participating in the StarkNet Hacker House. I am passionate about design, which is why I enjoy UI/UX, and I have a natural ability to create effects or design anything that might be needed. Along with my team, I won first place in one of the tracks at the Eth Pura Vida hackathon. My experience in both frontend and backend enables me to carry out a wide variety of tasks to achieve set goals.

I am also skilled in documentation, ensuring that the reading experience is clean, concise, and enjoyable for the reader. I apply various visual techniques to make the content engaging and appealing. I am a member of Dojo Coding, and I would really love to participate in the project with this issue.

@petersdt petersdt linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cairo-scripts difficult: easy enhancement New feature or request ODBoost This issue will be available ONLY during the ODBoost
Projects
None yet
Development

Successfully merging a pull request may close this issue.