KaizeNodeLabs / stark-cairo-nodes

Set of scripts written in Cairo/Starknet to learn and teach newcomers the ecosystem.
MIT License
16 stars 21 forks source link

Check even or odd in Cairo #29

Closed danielcdz closed 8 hours ago

danielcdz commented 3 days ago

Description

Steps

petersdt commented 3 days ago

@danielcdz kindly assign me this issue when ODhack10 starts

i experience in writing smart contracts and writing test for smart contracts a pseduo approach to the above would be as following:

  1. I'll create a function called 'check_even_odd' that takes a u256 number as input
  2. I'll use Cairo's modulo operator (%) to divide by 2 and check remainder: number % 2 will give me either 0 or 1
  3. for return value, I'll return a boolean:
    • true for even
    • false for odd
      1. I'll create test cases to verify:
    • I'll test with 0 (should be even)
    • I'll test with 1 (should be odd)
    • I'll test with some larger numbers
  4. error handling:

I'll need to consider:

Emrys02 commented 1 day ago

Hi @danielcdz my approach would be to use the modulo operator to determine if the input is even or odd then return an appropriate boolean

Michaelkingsdev commented 1 day ago

After learning cairo, i would love to get my hands on this task. The difficulty level is easy so i can handle it. My ETA is 48hrs. Thanks

SoarinSkySagar commented 1 day ago

May I work on this issue @danielcdz?

omsant02 commented 1 day ago

i would like to take this issue @danielcdz

i am a new contributor to repo and would like to start my contribution journey with stark-cairo-nodes

would solve this by if and else condition for number%2==0

Thank you

codeZe-us commented 1 day ago

Will write a script that checks if a number is even or odd. ETA: 2 hours.

Emmanex01 commented 1 day ago

Can I start working on this?

BrunoAmbricca commented 1 day ago

I would like to work on this issue

Thibrac commented 1 day ago

Hi, I'm level 6 on NG, I would do this issue if possible :)

mimisavage commented 1 day ago

Let me try this one!

aurlic commented 1 day ago

Hey ! I would love to work on this issue to put my newly acquired skill to the test. I am currently learning with NodeGuardians and think I could handle this. Thanks in advance !

GideonBature commented 1 day ago

I’d like to work on this.

My name is Gideon Bature, a Software Engineer with experience building Starknet based smart contracts, using Cairo. If given this issue, I should be able to send my first PR within 48 hrs.

Thank you!

Unickhub commented 1 day ago

Can I start working on this?

Benjtalkshow commented 1 day ago

I’d like to work on this.

ChrisFernandezVivas commented 1 day ago

hi ,im from dojo coding

my steps

1- try use a "%" module operand

if the module between 2 values is 0 , is even ..

akintewe commented 1 day ago

Hello can i be assigned this issue, i am a new contributor with experience in Cario, would love to work on this , my ETA is >5 Hours and ill create a draft PR in 4 hours time. Thank you for this opportunity. :)

MullerTheScientist commented 1 day ago

can i help with this task

ryzen-xp commented 1 day ago

Hi, I am proficient Blockchain developer expert in Cairo , Rust and Solidity and also in web development. I have contributed many cairo ,rust projects like chainevents , arkprojects etc . please /assign this issue . Thank You

mimiprosper commented 1 day ago

Can I start working on this? Am a web 2 frontend developer, a solidity smart contract developer/auditor and a cairo smart contract developer. Am a graduate of Starknet Cairo Bootcamp. I have successfully done tasks assigned to me in OnlyDust. If assigned this i would complete it within 1 day.