Cody

# Problem 174. Roll the Dice!

Solution 1407345

Submitted on 6 Jan 2018 by claus becker
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)

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