Created
May 6, 2017 15:35
-
-
Save mixdev/d51a204a905c02ce648fd4a4d7c050d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signal.trap("SIGINT") do # SIGINT = control-C | |
exit | |
end | |
str ='' | |
system("say 'Hi, whats your name?'") | |
sleep(0.5) | |
loop do | |
begin | |
system("stty raw -echo") | |
str << STDIN.getc | |
ensure | |
system("stty -raw echo") | |
end | |
break if str.length > 3 | |
end | |
p str | |
sleep(0.5) | |
system("say 'hello #{str}, nice to meet you!'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment