Created
March 10, 2013 19:39
-
-
Save yefim/5130068 to your computer and use it in GitHub Desktop.
Random guesser for the Guessing Game
This file contains 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
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