Created
January 31, 2015 22:00
-
-
Save OutlawGameTools/1376a7a09e5c4c1c7833 to your computer and use it in GitHub Desktop.
Corona: Returns true or false, randomly. Optionally pass in an int up to 100 to "weight" how often true is returned.
This file contains 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
local function coinToss(weighted) | |
local w = weighted or 50 | |
return math.random() <= w/100 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment