I have the following code:
require 'io/console'
loop do
character = STDIN.getch
break if character == "\n"
print "*"
end
The code is working, but I have to press the Enter key then another key to break the loop. Why? I have this issue only with the line feed.