Skip to content

Instantly share code, notes, and snippets.

@OutlawGameTools
Created January 31, 2015 22:00
Show Gist options
  • Save OutlawGameTools/1376a7a09e5c4c1c7833 to your computer and use it in GitHub Desktop.
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.
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