I would highly recommend using this code instead as it is simpler and easier to understand:
I personally don't think the last result is needed so I just did the flip coin part of the code!
Hope this helps,
Brady
I would highly recommend using this code instead as it is simpler and easier to understand: