Skip to content

Instantly share code, notes, and snippets.

@marks
Created August 31, 2010 03:36
Show Gist options
  • Select an option

  • Save marks/558504 to your computer and use it in GitHub Desktop.

Select an option

Save marks/558504 to your computer and use it in GitHub Desktop.
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