"Learn ruby the hard way" missing puts output on exercise 14 -


i'm working on exercise 14 friend, simple string interpolation , user input grabbing. code looks this:

user_name = argv.first                                                           prompt = '> '  puts "hi #{user_name}." puts "i'd ask few questions." puts "do me #{user_name}? ", prompt likes = $stdin.gets.chomp  puts = "where live #{user_name}? ", prompt lives = $stdin.gets.chomp  puts "what kind of computer have? ", prompt computer = $stdin.gets.chomp  puts """ alright, said #{likes} liking me. live in #{lives}. not sure is. , have #{computer} computer. nice. """ 

should work pretty simply, i'm finding after likes= line, next line prompting "where live" not displayed on screen, yet lives= prompted for. is, after entering "likes", "lines" prompt jumped without showing me prompt output before! next prompt starting @ computer= works expected.

i'm using ruby 2.1.2, same behavior appears on 2.2.3, , online repl here

why happen?

you have = after puts on line 8. removing should fix issue.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -