Skip to content

Instantly share code, notes, and snippets.

@jonasabreu
Created October 8, 2012 15:40
Show Gist options
  • Save jonasabreu/3853168 to your computer and use it in GitHub Desktop.
Save jonasabreu/3853168 to your computer and use it in GitHub Desktop.
judgedTask.success {
game.advance(index) { nextIndex =>
session.saveLast("/play/%s/task/%d".format(gameName, nextIndex))
result.redirectTo(this).task(gameName, nextIndex)
}
game.atEnd(index) {
session.endGame
result.include("gameEnded", "end")
result.redirectTo(this).index(gameName)
}
}
judgedTask.failure {
result.include("challenge", cleanChallenge)
result.redirectTo(this).task(gameName, index)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment