Greg Brannon wrote:So you have an array that can hold 6 values, 1 - 6, and a random number generator that generates random values 1 - 6. With two dice, the array will have to be scaled to hold the values 2 - 12 (11 total), and your random number generator will have to be modified to generate values from 2 - 12. Modifying the code you've already written should be relatively easy.
I thought about that, wouldn't that throw off the results of rolling 2 die with a 1-6 outcome and adding the values? I guess I am failing at the logic here.
Matthew Brown wrote:
Lucas Martin wrote:I thought about that, wouldn't that throw off the results of rolling 2 die with a 1-6 outcome and adding the values?
Yes, it would. You need to extend array, but then generate the index by adding together two random numbers from 1-6.
Sorry, I didn't think through the subtleties. I'd have gotten it wrong.