Skip to content

Instantly share code, notes, and snippets.

@jimtla
Created March 12, 2013 15:31
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 jimtla/5143896 to your computer and use it in GitHub Desktop.
Save jimtla/5143896 to your computer and use it in GitHub Desktop.
A perfect solution to AlexeyMK/guessing-game, although I can't help but feel it violates the spirit of the game.
cheater =
start_game: ->
@count = 0
global.Math = {random: => @count++}
guess_index: (cur_num) ->
return cur_num
name: "Cheater"
@yefim
Copy link

yefim commented Mar 13, 2013

Why not just Math.random = => @count++?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment