[Solved]Euclidian function in Tiresome GCD


#1

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

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


#2

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


#3

Exactly. B = number / number

How does that return false?


#4

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


#5

Thanks! That’s the bit I was missing.


#6

Marked as solved :+1: