This file contains hidden or 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
cheater = | |
start_game: -> | |
@count = 0 | |
global.Math = {random: => @count++} | |
guess_index: (cur_num) -> | |
return cur_num | |
name: "Cheater" |
This file contains hidden or 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
# Five lines of code that will make your underscore + CoffeeScript use cleaner. | |
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name. | |
# The R version moves the function argument (first argument in normal underscore) to the end, | |
# so you can write: | |
$(window).scroll _.throttleR 500, -> | |
console.log "This print's at most every 500ms" | |
# Instead of: | |
$(window).scroll _.throttle -> | |
console.log "This prints at most every 500ms too" |
NewerOlder