Cody

Solution 1876505

Submitted on 17 Jul 2019
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
assert(isempty(regexp(evalc('type rot_hardway'),'(eval|fliplr|flipud|flipdim|rot90|)')))

2   Fail
x = [1 2 3;4 5 6;7 8 9]; y_correct = [3 6 9;2 5 8;1 4 7]; assert(isequal(rot_hardway(x),y_correct))

y = 3 2 3 2 5 6 1 8 9 y = 3 2 3 8 5 6 9 8 9 y = 3 2 3 8 5 6 9 6 9 y = 3 2 3 8 5 2 9 6 3

Assertion failed.

3   Fail
x = [sqrt(-1) 2 3;4 5 6;7 8 9]; y_correct = [3 6 9;2 5 8;sqrt(-1) 4 7]; assert(isequal(rot_hardway(x),y_correct))

y = 3.0000 + 0.0000i 2.0000 + 0.0000i 3.0000 + 0.0000i 2.0000 + 0.0000i 5.0000 + 0.0000i 6.0000 + 0.0000i 0.0000 + 1.0000i 8.0000 + 0.0000i 9.0000 + 0.0000i y = 3 2 3 8 5 6 9 8 9 y = 3 2 3 8 5 6 9 6 9 y = 3 2 3 8 5 2 9 6 3

Assertion failed.

4   Fail
x = magic(9); y_correct = rot90(magic(9)); assert(isequal(rot_hardway(x),y_correct))

y = 45 58 69 80 1 12 23 34 45 34 68 79 9 11 22 33 44 46 23 78 8 10 21 32 43 54 56 12 7 18 20 31 42 53 55 66 1 17 19 30 41 52 63 65 76 80 27 29 40 51 62 64 75 5 69 28 39 50 61 72 74 4 15 58 38 49 60 71 73 3 14 25 47 48 59 70 81 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 68 79 9 11 22 33 44 46 59 78 8 10 21 32 43 54 56 70 7 18 20 31 42 53 55 66 81 17 19 30 41 52 63 65 76 2 27 29 40 51 62 64 75 5 13 28 39 50 61 72 74 4 15 24 38 49 60 71 73 3 14 25 35 48 59 70 81 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 79 9 11 22 33 44 46 59 49 8 10 21 32 43 54 56 70 60 18 20 31 42 53 55 66 81 71 19 30 41 52 63 65 76 2 73 29 40 51 62 64 75 5 13 3 39 50 61 72 74 4 15 24 14 49 60 71 73 3 14 25 35 25 59 70 81 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 9 11 22 33 44 46 59 49 39 10 21 32 43 54 56 70 60 50 20 31 42 53 55 66 81 71 61 30 41 52 63 65 76 2 73 72 40 51 62 64 75 5 13 3 74 50 61 72 74 4 15 24 14 4 60 71 73 3 14 25 35 25 15 70 81 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 11 22 33 44 46 59 49 39 29 21 32 43 54 56 70 60 50 40 31 42 53 55 66 81 71 61 51 41 52 63 65 76 2 73 72 62 51 62 64 75 5 13 3 74 64 61 72 74 4 15 24 14 4 75 71 73 3 14 25 35 25 15 5 81 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 17 22 33 44 46 59 49 39 29 19 32 43 54 56 70 60 50 40 30 42 53 55 66 81 71 61 51 41 52 63 65 76 2 73 72 62 52 62 64 75 5 13 3 74 64 63 72 74 4 15 24 14 4 75 65 73 3 14 25 35 25 15 5 76 2 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 17 7 33 44 46 59 49 39 29 19 18 43 54 56 70 60 50 40 30 20 53 55 66 81 71 61 51 41 31 63 65 76 2 73 72 62 52 42 64 75 5 13 3 74 64 63 53 74 4 15 24 14 4 75 65 55 3 14 25 35 25 15 5 76 66 13 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 17 7 78 44 46 59 49 39 29 19 18 8 54 56 70 60 50 40 30 20 10 55 66 81 71 61 51 41 31 21 65 76 2 73 72 62 52 42 32 75 5 13 3 74 64 63 53 43 4 15 24 14 4 75 65 55 54 14 25 35 25 15 5 76 66 56 24 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 17 7 78 68 46 59 49 39 29 19 18 8 79 56 70 60 50 40 30 20 10 9 66 81 71 61 51 41 31 21 11 76 2 73 72 62 52 42 32 22 5 13 3 74 64 63 53 43 33 15 24 14 4 75 65 55 54 44 25 35 25 15 5 76 66 56 46 35 y = 45 58 69 80 1 12 23 34 45 48 38 28 27 17 7 78 68 58 59 49 39 29 19 18 8 79 69 70 60 50 40 30 20 10 9 80 81 71 61 51 41 31 21 11 1 2 73 72 62 52 42 32 22 12 13 3 74 64 63 53 43 33 23 24 14 4 75 65 55 54 44 34 35 25 15 5 76 66 56 46 45

Assertion failed.