Question about until loop

Hi,

I’m a bit confused about the until loop. The explanation said that the until loop will run until a truthy condition is met.

until false
1==1
true
end

How come in the above block, the loop does not end even though truthy statements are being evaluated. What is the reason for the loop continuing. Is it because the “until” loop only ends when the condition == true? And since false will always be false, then a truthy condition is never met?

I’m probably overthinking this.

Thanks!
Ryan

Hi Ryan,

This is similar to the other question you posted. Basically, what is going on is exactly like how you put it in your last statement. False will always be false; it does not matter if there is a truthy statement in the until block. If you do want the “true” to end the until block, you will need to save it in a Boolean variable and have that be your conditional.

Best,
Michael Ruan

Thank you,

I was definitely overthinking it!