Cody

# Problem 174. Roll the Dice!

Solution 1870238

Submitted on 10 Jul 2019 by Andrew Gorrie
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x1 = zeros(1,6000); x2 = zeros(1,6000); for ii = 1:6000 [x1(ii),x2(ii)] = rollDice(); end numCt = sum( bsxfun( @eq, x1, (1:6)' ), 2 ) + sum( bsxfun( @eq, x2, (1:6)' ), 2 ); assert(all(round(numCt/200) == 10) && sum(numCt) == 12000)

tmp = 1 5 tmp = 1 5 tmp = 3 4 tmp = 3 1 tmp = 4 4 tmp = 4 6 tmp = 2 5 tmp = 6 2 tmp = 6 3 tmp = 5 6 tmp = 4 5 tmp = 5 5 tmp = 1 1 tmp = 5 5 tmp = 5 2 tmp = 1 4 tmp = 2 3 tmp = 1 6 tmp = 2 5 tmp = 5 5 tmp = 6 1 tmp = 5 2 tmp = 1 3 tmp = 5 6 tmp = 3 6 tmp = 1 3 tmp = 2 5 tmp = 5 6 tmp = 4 5 tmp = 4 6 tmp = 5 1 tmp = 1 4 tmp = 5 2 tmp = 2 5 tmp = 4 6 tmp = 4 2 tmp = 4 2 tmp = 2 4 tmp = 4 5 tmp = 1 5 tmp = 3 5 tmp = 4 4 tmp = 5 6 tmp = 2 6 tmp = 4 2 tmp = 2 1 tmp = 2 5 tmp = 1 6 tmp = 6 1 tmp = 3 5 tmp = 3 3 tmp = 6 6 tmp = 4 6 tmp = 1 4 tmp = 3 4 tmp = 1 3 tmp = 2 3 tmp = 6 1 tmp = 4 3 tmp = 1 5 tmp = 5 4 tmp = 5 4 tmp = 6 1 tmp = 3 2 tmp = 4 4 tmp = 3 2 tmp = 5 1 tmp = 3 6 tmp = 1 2 tmp = 4 1 tmp = 5 6 tmp = 2 3 tmp = 5 2 tmp = 4 1 tmp = 6 5 tmp = 3 1 tmp = 2 6 tmp = 3 6 tmp = 5 5 tmp = 1 1 tmp = 1 1 tmp = 1 6 tmp = 5 5 tmp = 4 2 tmp = 4 5 tmp = 6 1 tmp = 1 5 tmp = 4 2 tmp = 1 3 tmp = 4 1 tmp = 2 2 tmp = 1 2 tmp = 1 5 tmp = 2 6 tmp = 3 5 tmp = 6 1 tmp = 5 3 tmp = 2 6 tmp = 4 3 tmp = 6 1 tmp = 1 3 tmp = 5 4 tmp = 6 4 tmp = 6 6 tmp = 1 5 tmp = 5 1 tmp = 5 2 tmp = 5 5 tmp = 5 3 tmp = 5 6 tmp = 4 2 tmp = 2 4 tmp = 2 5 tmp = 4 4 tmp = 6 2 tmp = 6 4 tmp = 5 2 tmp = 1 5 tmp = 6 3 tmp = 6 6 tmp = 2 3 tmp = 1 2 tmp = 3 4 tmp = 6 2 tmp = 1 3 tmp = 2 4 tmp = 1 2 tmp = 2 6 tmp = 6 5 tmp = 4 5 tmp = 1 3 tmp = 3 3 tmp = 5 3 tmp = 1 4 tmp = 6 4 tmp = 3 6 tmp = 6 4 tmp = 5 6 tmp = 4 5 tmp = 6 4 tmp = 2 3 tmp = 4 6 tmp = 5 5 tmp = 5 1 tmp = 4 2 tmp = 6 3 tmp = 3 3 tmp = 3 6 tmp = 4 5 tmp = 3 1 tmp = 4 3 tmp = 2 4 tmp = 4 6 tmp = 5 1 tmp = 2 5 tmp = 6 4 tmp = 2 4 tmp = 3 1 tmp = 2 5 tmp = 5 5 tmp = 2 5 tmp = 4 1 tmp = 5 2 tmp = 6 2 tmp = 3 2 tmp = 5 4 tmp = 5 5 tmp = 3 6 tmp = 5 5 tmp = 5 4 tmp = 5 1 tmp = 3 2 tmp = 5 6 tmp = 2 5 tmp = 5 5 tmp = 6 3 tmp = 1 5 tmp = 3 6 tmp = 2 5 tmp = 3 5 tmp = 4 3 tmp = 3 2 tmp = 5 5 tmp = 3 2 tmp = 2 4 tmp = 6 6 tmp = 3 6 tmp = 5 4 tmp = 6 3 tmp = 6 3 tmp = 5 4 tmp = 6 1 tmp = 5 5 tmp = 2 3 tmp = 3 1 tmp = 3 2 tmp = 4 2 tmp = 6 4 tmp = 1 2 tmp = 4 2 tmp = 5 2 tmp = 5 1 tmp = 2 4 tmp = 3 3 tmp = 3 3 tmp = 2 3 tmp = 4 6 tmp = 6 2 tmp = 5 3 tmp = 1 6 tmp = 3 3 tmp = 5 3 tmp = 4 6 tmp = 2 2 tmp = 5 5 tmp = 1 3 tmp = 4 4 tmp = 4 6 tmp = 4 1 tmp = 4 4 tmp = 2 4 tmp = 2 1 tmp = 2 1 tmp = 3 1 tmp = 6 6 tmp = 2 6 tmp = 5 2 tmp = 3 1 tmp = 1 3 tmp = 5 6 tmp = 2 1 tmp = 1 4 tmp = 5 5 tmp = 3 3 tmp = 5 5 tmp = 2 5 tmp = 4 6 tmp = 3 6 tmp = 1 1 tmp = 3 6 tmp = 4 6 tmp = 3 6 tmp = 3 5 tmp = 6 4 tmp = 4 1 tmp = 6 3 tmp = 3 2 tmp = 1 3 tmp = 2 3 tmp = 5 3 tmp = 2 3 tmp = 6 6 tmp = 3 5 tmp = 6 3 tmp = 4 1 tmp = 1 1 tmp = 3 5 tmp = 2 6 tmp = 6 6 tmp = 6 3 tmp = 4 5 tmp = 6 3 tmp = 1 3 tmp = 6 4 tmp = 4 5 tmp = 2 4 tmp = 5 3 tmp = 1 3 tmp = 4 4 tmp = 4 3 tmp = 2 2 tmp = 1 5 tmp = 3 1 tmp = 4 5 tmp = 2 4 tmp = 3 2 tmp = 5 1 tmp = 5 2 tmp = 1 4 tmp = 4 4 tmp = 1 5 tmp = 4 3 tmp = 5 2 tmp = 2 1 tmp = 4 4 tmp = 6 3 tmp = 3 4 tmp = 3 1 tmp = 4 6 tmp = 4 5 tmp = 5 1 tmp = 6 2 tmp = 1 5 tmp = 6 1 tmp = 4 5 tmp = 5 2 tmp = 5 4 tmp = 5 6 tmp = 1 1 tmp = 1 3 tmp = 1 2 tmp = 1 5 tmp = 2 4 tmp = 1 6 tmp = 5 1 tmp = 5 6 tmp = 4 6 tmp = 6 1 tmp = 1 5 tmp = 5 2 tmp = 6 4 tmp = 6 6 tmp = 5 3 tmp = 1 6 tmp = 2 1 tmp = 2 5 tmp = 5 4 tmp = 6 4 tmp = 3 3 tmp = 6 2 tmp = 2 6 tmp = 3 3 tmp = 3 2 tmp = 1 5 tmp = 1 1 tmp = 1 1 tmp = 2 4 tmp = 3 5 tmp = 1 1 tmp = 2 2 tmp = 4 3 tmp = 6 3 tmp = 5 5 tmp = 2 5 tmp = 2 4 tmp = 1 5 tmp = 5 3 tmp = 5 4 tmp = 3 1 tmp = 5 1 tmp = 1 5 tmp = 4 2 tmp = 4 2 tmp = 1 5 tmp = 2 6 tmp = 6 3 tmp = 2 2 tmp = 2 2 tmp = 1 2 tmp = 3 2 tmp = 2 4 tmp = 6 1 tmp = 6 4 tmp = 5 3 tmp = 5 1 tmp = 6 2 tmp = 4 5 tmp = 1 4 tmp = 5 1 tmp = 2 4 tmp = 1 5 tmp = 3 2 tmp = 6 3 tmp = 2 5 tmp = 1 2 tmp = 1 1 tmp = 1 4 tmp = 3 1 tmp = 5 6 tmp = 1 6 tmp = 6 2 tmp = 4 1 tmp = 2 5 tmp = 5 4 tmp = 5 4 tmp = 2 6 tmp = 2 5 tmp = 2 4 tmp = 5 1 tmp = 2 5 tmp = 6 3 tmp = 3 6 tmp = 6 4 tmp = 4 1 tmp = 1 5 tmp = 2 3 tmp = 5 4 tmp = 4 6 tmp = 6 1 tmp = 5 4 tmp = 5 3 tmp = 5 1 tmp = 1 3 tmp = 2 6 tmp = 6 1 tmp = 6 5 tmp = 4 5 tmp = 3 3 tmp = 3 3 tmp = 3 4 tmp = 1 4 tmp = 4 6 tmp = 4 1 tmp = 4 1 tmp = 3 5 tmp = 1 5 tmp = 1 5 tmp = 5 3 tmp = 1 4 tmp = 6 3 tmp = 1 3 tmp = 3 4 tmp = 2 6 tmp = 5 2 tmp = 6 2 tmp = 6 2 tmp = 3 2 tmp = 6 1 tmp = 5 6 tmp = 3 4 tmp = 6 6 tmp = 6 3 tmp = 2 1 tmp = 6 3 tmp = 4 4 tmp = 5 3 tmp = 3 5 tmp = 6 6 tmp = 1 1 tmp = 6 1 tmp = 1 1 tmp = 2 4 tmp = 5 3 tmp = 1 6 tmp = 2 ...