Cody

# Problem 2565. Determine the Result of a Move in Reversi

Solution 1188442

Submitted on 14 May 2017 by Said BOUREZG
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
boardIn = ... [ 0 0 0 0 0 1 2 0 0 2 1 0 0 0 0 0 ]; side = 1; move = 14; boardOut = ... [ 0 0 0 0 0 1 1 1 0 2 1 0 0 0 0 0 ]; assert(isequal(boardOut,boardResult(boardIn,side,move)))

m = 2 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 0 0 0 0 1 1 1 1 0 2 1 0 0 0 0 0 x = 0 0 0 1 1 1 1 1 0 2 1 1 0 0 0 1 ans = 0 0 0 0 0 1 1 1 0 2 1 0 0 0 0 0

2   Pass
boardIn = ... [ 0 0 0 0 0 1 1 1 0 2 1 0 0 0 0 0 ]; side = 2; move = 5; boardOut = ... [ 0 2 0 0 0 2 1 1 0 2 1 0 0 0 0 0 ]; assert(isequal(boardOut,boardResult(boardIn,side,move)))

m = 1 ans = 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 ans = 2 2 2 2 1 2 1 1 1 2 1 1 1 2 1 1 x = 1 1 1 1 0 1 1 1 0 2 1 0 0 0 0 0 x = 1 1 1 1 0 1 1 1 0 1 1 0 0 1 0 0 ans = 0 2 0 0 0 2 1 1 0 2 1 0 0 0 0 0

3   Pass
boardIn = ... [ 0 2 0 0 0 2 1 1 0 2 1 0 0 0 0 0 ]; side = 1; move = 4; boardOut = ... [ 0 2 0 0 0 2 1 1 0 1 1 0 1 0 0 0 ]; assert(isequal(boardOut,boardResult(boardIn,side,move)))

m = 0 m = 4 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 0 2 0 0 0 2 1 1 0 1 1 0 1 1 1 1 x = 1 2 0 0 1 2 1 1 1 1 1 0 1 1 1 1 ans = 0 2 0 0 0 2 1 1 0 1 1 0 1 0 0 0

4   Pass
boardIn = ... [ 0 0 0 0 0 0 1 1 2 2 0 2 1 1 0 0 0 2 1 0 0 0 0 0 0 ]; side = 1; move = 9; boardOut = ... [ 0 0 0 0 0 0 1 1 2 2 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 ] assert(isequal(boardOut,boardResult(boardIn,side,move)))

boardOut = 0 0 0 0 0 0 1 1 2 2 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 m = 4 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ans = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 0 0 0 0 0 0 1 1 2 2 0 2 1 1 0 1 1 1 1 1 0 0 0 0 0 x = 0 1 0 0 0 0 1 1 2 2 0 1 1 1 0 1 1 1 1 1 0 1 0 0 0 ans = 0 0 0 0 0 0 1 1 2 2 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0