should change the test suite to also include moves of 1,1 or 2,2 which this solution would not prevent...
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
a = ...
[ 7 2 5
4 0 8
1 6 3];
tf_correct = true;
assert(isequal(knights_tour(a),tf_correct))
|
2 | Fail |
a = ...
[ 1 0 0
0 0 2];
tf_correct = true;
assert(isequal(knights_tour(a),tf_correct))
|
3 | Fail |
a = ...
[ 15 5 12 3
0 2 9 6
8 11 4 13
1 14 7 10];
tf_correct = false;
assert(isequal(knights_tour(a),tf_correct))
|
4 | Fail |
a = ...
[ 0 5 12 3
15 2 9 6
8 11 4 13
1 14 7 10];
tf_correct = true;
assert(isequal(knights_tour(a),tf_correct))
|
5 | Fail |
a = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 36 17;9 2 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];
tf_correct = true;
assert(isequal(knights_tour(a),tf_correct))
|
6 | Fail |
a = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 0 17;2 9 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];
tf_correct = false;
assert(isequal(knights_tour(a),tf_correct))
|
7 | Fail |
a = [1 0 0;0 0 0;2 0 0];
tf_correct = false;
assert(isequal(knights_tour(a),tf_correct))
|
Return the largest number that is adjacent to a zero
3749 Solvers
150 Solvers
Find nearest prime number less than input number
268 Solvers
Solving Quadratic Equations (Version 1)
427 Solvers
373 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!