the code
pragma solidity ^0.4.13;
contract TicTacToe {
uint[3][] arr ;
function isSolved(int[3][] board) returns (int) {
arr = board;
//检查每个数组是不是横向的存在
int check = 0;
int h1 = checkH(arr[1]);
if(h1 == -1){
int h2 = checkH(arr[2]);
if(h2 == -1){
int h3 = checkH(arr[3]);
check = h3;
}else{
check = h2;
}
}else{
check = h1;
}
if(check == -1){
check = checkS(arr);
if(check == -1){
check = checkX(arr);
}
}
if(check == -1){
check = 0;
}
if(check == 0){
check = -1;
}
return check;
}
//检查横向数值是不是相等
function checkH(int[] h) private returns (int) {
if(h[0] == h[1] && h[1] == h[2]){
return h[0];
}
return -1;//平局
}
//检查竖向的
function checkS(int[3][] board) private returns (int) {
if(board[0][0] == board[1][0] && board[1][0] == board[2][0]){
return board[1][0];
}
if(board[0][1] == board[1][1] && board[1][1] == board[2][1]){
return board[1][0];
}
if(board[0][2] == board[1][2] && board[1][2] == board[2][2]){
return board[1][0];
}
return -1;//平局
}
//检查斜向的
function checkX(int[3][] board) private returns (int) {
if(board[0][0] == board[1][1] && board[1][1] == board[2][2]){
return board[0][0];
}
if(board[0][2] == board[1][1] && board[1][1] == board[2][0]){
return board[0][2];
}
return -1;//平局
}
}
Error
/home/codewarrior/solidity/contracts/solution.sol:18:15: TypeError: Type int256[3] memory[] memory is not implicitly convertible to expected type uint256[3] storage ref[] storage ref.
arr = board;
^---^
,/home/codewarrior/solidity/contracts/solution.sol:22:26: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
int h1 = checkH(arr[1]);
^----^
,/home/codewarrior/solidity/contracts/solution.sol:25:30: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
int h2 = checkH(arr[2]);
^----^
,/home/codewarrior/solidity/contracts/solution.sol:27:34: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
int h3 = checkH(arr[3]);
^----^
,/home/codewarrior/solidity/contracts/solution.sol:39:28: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref[] storage ref to int256[3] memory[] memory requested.
check = checkS(arr);
^-^
,/home/codewarrior/solidity/contracts/solution.sol:41:32: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref[] storage ref to int256[3] memory[] memory requested.
check = checkX(arr);
^-^
Compiliation failed. See above.
help me please!