Created
October 26, 2012 17:05
-
-
Save johntdyer/3959962 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
| ask "", :choices => "[ANY]" | |
| event = ask "When did Alexander Graham Bell patent the telephone? Was it A - January 30, 1877, B - March 10, 1876, or C - May 2, 1880?", { | |
| :choices => "A(A, a), B(B, b), C(C, c)", | |
| :attempts => 2, | |
| :timeout => 60, | |
| :onChoice => lambda { |event| | |
| say "You chose " + event.value | |
| if (event.value == "A") | |
| say "That's right!" | |
| else | |
| say "I'm sorry, that's incorrect. Please try again!" | |
| end | |
| }, | |
| :onBadChoice => lambda { |event| | |
| say "That wasn't one of the choices, please try again." }, | |
| :onTimeout => lambda { |event| | |
| say "Sorry, didn't get that, please try again." } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment