Skip to content

Instantly share code, notes, and snippets.

@gshzn
Created February 8, 2016 18:35
Show Gist options
  • Save gshzn/0941e5792c8ca3c9cf7a to your computer and use it in GitHub Desktop.
Save gshzn/0941e5792c8ca3c9cf7a to your computer and use it in GitHub Desktop.
int d = Math.random() * 100;
int chance = {YOUR CHANCE OF THE ITEM HERE}
if (d <= chance) {
//CONTINUE, TRUE
} else {
// DON'T CONTINUE, FALSE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment