I'm tinkering with a basic Tower of Hanoi game, and trying to get user input twice, but print both prompts on the same line (separated by the first input). I've searched for awhile, maybe I'm using the wrong terms. I assume the new line is due to gets, or setting it to a variable, but how do I get rid of it? Thanks!
print "Move FROM which tower? (1 / 2 / 3) "
answer1 = gets.chomp.to_i
print "...TO which tower? (1 / 2 / 3) "
answer2 = gets.chomp.to_i
I want this:
Move FROM which tower? (1 / 2 / 3) 1 ...TO which tower? (1 / 2 / 3) 2
But I'm getting this:
*Move FROM which tower? (1 / 2 / 3) 1
...TO which tower? (1 / 2 / 3) 2
(input in bold)