Coding Approach Question

I am a new student to Ruby and am looking for some input on which
practices I should be following. I realize there will always be a number
of ways to approach different situations, but I am wondering if there
are incorrect ways to approach problems.

For my example, I have attached two “working” loop programs in which you
guess a number the computer is thinking between 0 and 10.

My question is it wrong in this situation of looping to use break to end
the loop early if the answer is right so the program does not repeat the
incorrect response when the answer is right. Or should I be using the
condition method to accomplish this as in the other example?

Both programs run identically.

You would have to show your code for more detailed replies. Having two
loops nested is perfectly OK. I personally would not use “break” but
rather a loop with the test at the end because I find this more elegant:

loop do
number = think

begin
guess = read_input
end until guess == number
end