Skip to content

Commit

Permalink
Don't use _.random that we don't have.
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser committed Oct 15, 2012
1 parent c86a472 commit fe70fbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/client/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,12 @@ <h2 id="accounts_api"><span>Accounts</span></h2>

Example:

<!-- XXX replace d6 with _.random once we have underscore 1.4.2 -->

// Support for playing D&D: Roll 3d6 for dexterity
Accounts.onCreateUser(function(options, user) {
user.dexterity = _.random(1, 6) + _.random(1, 6) + _.random(1, 6)
var d6 = function () { return Math.floor(Math.random() * 6) + 1; };
user.dexterity = d6() + d6() + d6();
return user;
});

Expand Down

0 comments on commit fe70fbd

Please sign in to comment.