Created
August 31, 2010 03:36
-
-
Save marks/558504 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
| answer() | |
| result = ask("What's your favorite color?", [ | |
| attempts: 3, | |
| choices: "red, blue, green", | |
| onBadChoice: { event-> | |
| switch(event.attempt){ | |
| case 1: | |
| say "We don't support that color. You can say red, blue or green." | |
| break | |
| case 2: | |
| say "It's really simple, man. Just say red, blue or green." | |
| break | |
| }}, | |
| onChoice: { event-> | |
| log('logColor: ' + event.value) | |
| say("Thanks for voting!") | |
| } | |
| ]) | |
| hangup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment