Skip to content

Instantly share code, notes, and snippets.

@st98
Created June 21, 2014 13:55
Show Gist options
  • Save st98/0e388ee9239742395476 to your computer and use it in GitHub Desktop.
Save st98/0e388ee9239742395476 to your computer and use it in GitHub Desktop.
CoffeeScript で randint(max = 2)。
randint = (max = 2) ->
return Math.floor Math.random() * max
[s, i] = [[], 10]
s.push randint() while i-- > 0
console.log s.join ', '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment