Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Press a key"
- key = STDIN.getc
- puts key.class
- puts "You have pressed #{key}"
- puts key.class
- while key != "f" do
- case key
- when "g"
- puts "It's 'g'"
- when "h"
- puts "It's 'h'"
- when "j"
- puts "It's 'j'"
- else
- puts "You gave me #{key} -- I have no idea what to do with that."
- end
- puts "Press a key"
- key = STDIN.getc
- puts "You have pressed #{key}"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement