Test  Status  Code Input and Output 

1  Pass 
filetext = fileread('shuffle.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')

2  Pass 
v = [1, 2, 3, 4, 5, 6, 7, 8];
n = 1;
w_correct = 8 : 1 : 1;
assert(isequal(shuffle(v, n), w_correct))
n =
1
v =
8
7
n =
2
v =
8
7
6
n =
3
v =
8
7
6
5
n =
4
v =
8
7
6
5
4
n =
5
v =
8
7
6
5
4
3
n =
6
v =
8
7
6
5
4
3
2
n =
7
v =
8
7
6
5
4
3
2
1
n =
8
cetvor =
8 7 6 5 4 3 2 1

3  Pass 
v = [1; 2; 3; 4; 5; 6; 7; 8];
n = 2;
w_correct = [7;8; 5;6; 3;4; 1;2];
assert(isequal(shuffle(v, n), w_correct))
n =
2
v =
7
8
5
6
n =
4
v =
7
8
5
6
3
4
n =
6
v =
7
8
5
6
3
4
1
2
n =
8

4  Pass 
v = [1, 2, 3, 4, 5, 6, 7, 8];
n = 3;
w_correct = [6,7,8, 3,4,5, 1,2];
assert(isequal(shuffle(v, n), w_correct))
n =
3
n =
6
n =
8

5  Pass 
v = [1; 2; 3; 4; 5; 6; 7; 8];
n = 4;
w_correct = [5;6;7;8; 1;2;3;4];
assert(isequal(shuffle(v, n), w_correct))
n =
4
v =
5
6
7
8
1
2
3
4
n =
8

6  Pass 
v = [1, 2, 3, 4, 5, 6, 7, 8];
n = 5;
w_correct = [4,5,6,7,8, 1,2,3];
assert(isequal(shuffle(v, n), w_correct))
n =
5
n =
8

7  Pass 
v = [1; 2; 3; 4; 5; 6; 7; 8];
n = 6;
w_correct = [3;4;5;6;7;8; 1;2];
assert(isequal(shuffle(v, n), w_correct))
n =
6
v =
3
4
5
6
7
8
1
2
n =
8

8  Pass 
v = [1, 2, 3, 4, 5, 6, 7, 8];
n = 7;
w_correct = [2,3,4,5,6,7,8, 1];
assert(isequal(shuffle(v, n), w_correct))
n =
7
n =
8

9  Pass 
v = [1; 2; 3; 4; 5; 6; 7; 8];
n = 8;
w_correct = [1;2;3;4;5;6;7;8];
assert(isequal(shuffle(v, n), w_correct))
n =
8

10  Pass 
v = [1, 2, 3, 4, 5, 6, 7, 8];
n = 9;
w_correct = [1,2,3,4,5,6,7,8];
assert(isequal(shuffle(v, n), w_correct))
n =
8

662 Solvers
Make an awesome ramp for a tiny motorcycle stuntman
353 Solvers
475 Solvers
427 Solvers
129 Solvers