Cody

Solution 1714749

Submitted on 24 Jan 2019 by Mu
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
AB = [ 0 0 ; 6 -8 ]; F = [ -4 4 4 -4 2 2 -4 -4 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 2; assert(isequal(n,n_correct));

2   Pass
AB = [ 0 0 ; 4 -6 ]; F = [ -6 4 0 -0 2 -4 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 2; assert(isequal(n,n_correct));

3   Pass
AB = [ 6 -6 ; 0 0 ]; F = [ -8 -8 4 2 -4 -0 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 1; assert(isequal(n,n_correct));

4   Pass
AB = [ 8 -6 ; 6 -8 ]; F = [ -6 0 -3 7 9 4 6 -4 -7 -2 -7 -8 -9 -9 0 -4 1 7 -0 4 -1 -7 -5 -9 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 7; assert(isequal(n,n_correct));

5   Pass
n_correct = randi(9)-1; AB = [ 0 0 ; n_correct*2-9 -10 ]; F = [ -2 -2 2 2 -2 -2 2 2 -2 -2 2 2 -2 -2 4 4 -8 -6 -6 -4 -4 -2 -2 -0 -0 2 2 4 4 6 6 -8 ]; n = WayfindingBoundaryCrossing(AB,F); assert(isequal(n,n_correct));