Cody

Solution 2080085

Submitted on 4 Jan 2020
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   Fail
board = [ ... 0 0 0 2 0 0 4 4 0 0 0 16 0 0 0 16]; dir = 'up'; newBoard = [ ... 0 0 4 2 0 0 0 4 0 0 0 32 0 0 0 0 ]; assert(isequal(nextMove(board,dir),newBoard))

Undefined function 'nextMove' for input arguments of type 'double'. Error in Test1 (line 12) assert(isequal(nextMove(board,dir),newBoard))

2   Fail
board = [ ... 0 2 128 4 0 16 4 32 0 8 0 0 0 0 2 0 ]; dir = 'right'; newBoard = [ ... 0 2 128 4 0 16 4 32 0 0 0 8 0 0 0 2 ]; assert(isequal(nextMove(board,dir),newBoard))

Undefined function 'nextMove' for input arguments of type 'double'. Error in Test2 (line 12) assert(isequal(nextMove(board,dir),newBoard))

3   Fail
board = [ ... 0 8 0 4 2 64 16 2 2 8 8 16 4 2 2 4 ]; dir = 'left'; newBoard = [ ... 8 4 0 0 2 64 16 2 2 16 16 0 4 4 4 0 ]; assert(isequal(nextMove(board,dir),newBoard))

Undefined function 'nextMove' for input arguments of type 'double'. Error in Test3 (line 12) assert(isequal(nextMove(board,dir),newBoard))

4   Fail
board = [ ... 0 4 4 4 4 4 4 0 2 2 2 2 0 0 0 0 ] dir = 'left' newBoard = [ ... 8 4 0 0 8 4 0 0 4 4 0 0 0 0 0 0 ] assert(isequal(nextMove(board,dir),newBoard))

board = 0 4 4 4 4 4 4 0 2 2 2 2 0 0 0 0 dir = 'left' newBoard = 8 4 0 0 8 4 0 0 4 4 0 0 0 0 0 0

Undefined function 'nextMove' for input arguments of type 'double'. Error in Test4 (line 12) assert(isequal(nextMove(board,dir),newBoard))