今天刚开始自学java,求问一个简单的问题,这个方法为什么不对,错误信息是
Required: Direction(另外一个类?)
found:int
static Direction tileCodeToOrientation(int tileCode) {
int tileIndex = tileCode % 4;
int boardPosition;
if (tileIndex >= 0 && tileIndex<=2){
boardPosition = tileIndex + 6;
}
else if (tileIndex >= 3 && tileIndex<=5){
boardPosition = tileIndex + 8;
}
else if (tileIndex >= 6 && tileIndex<=8){
boardPosition = tileIndex + 10;
}
/* tiles index board board position
col: 3 2 1 row: col: 3 2 1 row: 0 1 2 1 0 1 2 1 3 4 5 2 3 4 5 2 6 7 8 3 6 7 8 3*/
return boardPosition;就是想把第一个board上的数字转换成第二个上面的,再输出
慕村9548890
Cats萌萌
随时随地看视频慕课网APP
相关分类