Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local times = ...
- local heads = 0
- local tails = 0
- for flips = 1, times do
- coin = math.random(1,2) -- Can be increased for more range, just be sure to update the checks
- if coin == 1 then
- heads = heads + 1
- elseif coin == 2 then
- tails = tails + 1
- end
- end
- print(heads .. " heads and " .. tails .. " tails.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement