[SOLVED] Euclidian function in Tiresome GCD

I “solved” the level. But I don’t understand part of the function.

Why isn’t the “while(b)” section an endless loop?

I don’t really remember that I saw this level before, but for your question

From what I can understand from your question, there was an while(b) loop in the level, it is not endless because b is a variable, which means that it can change, so when b is true, the while loop will continue working, once it turns to false, the while loop will exit

Exactly. B = number / number

How does that return false?

when the first number is zero, b will equal to zero, which means false, so the while loop will exit

1 Like

Thanks! That’s the bit I was missing.

Marked as solved :+1: