Coding challenge

John and Mary have a six sided non-weighted dice. They want to decide who should start a game an decide that whoever throws the dice and gets 6 should start first. Write some code to find, if Mary throws the dice first, what is the probability that she wins? What about John (throwing second)? Use math.random(1,6) to simulate a dice throw. Note, finding probabilities in this way, requires many, many "trials" of your logic. (Ans: Mary: 5/11, John: 6/11.)

Type your code here:


Lua reference

See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code: