Cody

Problem 776. TRON strategy toggle

Solution 100703

Submitted on 20 Jun 2012 by Christopher
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
%% board=zeros(50); board([1,end],:)=-3; board(:,[1,end])=-3; board(2,2) = 1; board(49,49)=2; y_correct = true; assert(isequal(onSameSide(board),y_correct))

``` result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1...```

2   Fail
%% board=zeros(50); board([1,end],:)=-3; board(:,[1,end])=-3; board(5,25) = 1; board(46,25)=2; board(25,2:49)=-2; y_correct = false; assert(isequal(onSameSide(board),y_correct))

``` result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 1 result = 0 result = 1 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 result = 1 result = 0 r```