"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
Post a Comment