diff --git a/exercises/practice/collatz-conjecture/.meta/src/example.cr b/exercises/practice/collatz-conjecture/.meta/src/example.cr index 53a0f1cb..6084941a 100644 --- a/exercises/practice/collatz-conjecture/.meta/src/example.cr +++ b/exercises/practice/collatz-conjecture/.meta/src/example.cr @@ -7,13 +7,13 @@ module CollatzConjecture n = input steps = 0 until n == 1 - if n % 2 == 0 - n = n / 2 + if n.divisible_by?(2) + n /= 2 else n = 3 * n + 1 end - steps = steps + 1 + steps += steps end steps