Skip to content

Instantly share code, notes, and snippets.

@jimkang
Created February 4, 2014 16:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimkang/8806696 to your computer and use it in GitHub Desktop.
Save jimkang/8806696 to your computer and use it in GitHub Desktop.
var costMagnitudeRoll = ~~(Math.random() * 100);
if (costMagnitudeRoll < 70) {
cost = Math.random() * 30;
}
else if (costMagnitudeRoll < 90) {
cost = Math.random() * 70 + 30;
}
else if (costMagnitudeRoll < 99) {
cost = Math.random() * 400 + 100;
}
else {
cost = Math.random() * 9500 + 500;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment