posted
I've been working on a nifty program that figures out what number you're thinking of by binary division. (Is it 500? Is it 750? Is it 625?..., until it gets it.)
Then I realized a problem:
quote: lowerbound = guessNumber.dup
This method is a string method. I could convert guessNumber back to a string, dup it, then convert back. But there has to be a better way. What's the method I need?
posted
Because I want lowerbound to take the value of guessNumber and then I want to change guessNumber's value without changing that of lowerbound.
Posts: 3060 | Registered: Nov 2003
| IP: Logged |