Why does gets always add a new line when the user inputs the number of boxes?
I want the next print statement to be shown on the same line as the input.
print "Enter the number of boxes: "
boxes = gets.chomp
print "Enter number of columns to print the boxes in: "
columns = gets.chomp
I want output to look like this:
Enter the number of boxes: 47 Enter number of columns to print the boxes in: 4
I don’t want to begin a new line until after the second input is received.
In windows you can do it like this, otherwise you would need a similar read_char method that works in your OS