onlydustxyz / starklings

An interactive tutorial to get you up and running with Starknet
309 stars 83 forks source link

Solution is not correct #214

Open 0xKarl98 opened 2 years ago

0xKarl98 commented 2 years ago

Under recursions / collatz_sequence.cairo , the answer is :

image

Which it should be

image

and in terms of the test ,

image

it didn't stop the computation when n reaches to 1 , so the correct version should be

image
Codiumdium commented 2 years ago

Hello ! Your code does not return the nth number of collatz from the seed. This is the purpose of this exercise. (step == nth)

(You can use ``` some code ``` for your code).

0xKarl98 commented 2 years ago

Ah.. yeah what i'm trying to do is that this exercise didn't include the situation where the seed would be 0 , which is not satisfiable for us .
And also in terms of the step interation , i think it shoud be step = step + 1 , instead of step = step -1