Most of the helper methods are just borrowed from Problem 3. What I like about this problem is that even though often blocks in Ruby provide a unique way of solving a problem you can also use more traditional control structures to express an equally elegant solution.
Of course Ruby adds elegance even to traditional control structures by not just having a while loop but also a until loop. So rather than having to an ugly “while !true” you can have a nicer “until true”. Also the loop can be a more traditional block structure or used as a statement modifier as this problem demonstrates both methods.