Skip to content

Instantly share code, notes, and snippets.

@yefim
Created March 10, 2013 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yefim/5130068 to your computer and use it in GitHub Desktop.
Save yefim/5130068 to your computer and use it in GitHub Desktop.
Random guesser for the Guessing Game
contestant = {
start_game: (configs) ->
@guesses = [0..configs.game_size-1]
guess_index: (input) ->
i = Math.floor(Math.random() * @guesses.length)
@guesses.splice(i, 1)[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment