Cody

# Problem 42380. Dice roll - opposite faces

Solution 688116

Submitted on 17 Jun 2015 by James
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
%% x = 1; y_correct = 6; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 6

2   Pass
%% x = 2; y_correct = 5; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 5

3   Pass
%% x = 3; y_correct = 4; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 4

4   Pass
%% x = 4; y_correct = 3; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 3

5   Pass
%% x = 5; y_correct = 2; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 2

6   Pass
%% x = 6; y_correct = 1; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 1

7   Pass
%% x = 1:6; y_correct = 6:-1:1; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 6 5 4 3 2 1

8   Pass
%% x = [6,4,3]; y_correct = [1,3,4]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 1 3 4

9   Pass
%% x = [5,5,2]; y_correct = [2,2,5]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 2 2 5

10   Pass
%% x = [3,1,6]; y_correct = [4,6,1]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 4 6 1

11   Pass
%% x = [5,4,3]; y_correct = [2,3,4]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 2 3 4

12   Pass
%% x = [3,1,2,6,1,5,4,6,1,3]; y_correct = [4,6,5,1,6,2,3,1,6,4]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 4 6 5 1 6 2 3 1 6 4

13   Pass
%% x = [1,6,1,5,5,6,1,3,2,5]; y_correct = [6,1,6,2,2,1,6,4,5,2]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 6 1 6 2 2 1 6 4 5 2

14   Pass
%% x = [3,6,2,2,1,1,6,4,4,1]; y_correct = [4,1,5,5,6,6,1,3,3,6]; assert(isequal(dice_roll_opposite_face(x),y_correct))

ans = 4 1 5 5 6 6 1 3 3 6