Coding challenge

Three 6-sided dice are rolled. Use math.random(1,6) to simulate a dice roll, and write some code that find the probability that the values shown on two of the dice sum to the value on the remaining die. (Ans: 0.21) (Ref: ACM 2014 10A, #17.)

Type your code here:


Lua reference

See your results here: