-4
int movedistance = 5; // Distance to move the board
@Override
public byte getLive(int x, int y) {
return board[y][x]; // Arraylist board.get(y).get(x) ?
}
public void patternRight(){
byte[][] testBoard = new byte[getHeight()][getWidth()];
// testBoard = new Arraylist<> ?
for (int x = 0; x < getHeight(); x++) {
for (int y = 0; y < getWidth(); y++){
if (getLive(y, x) == 1) testBoard[x][y + movedistance] = 1;
}
}
}
我正在尝试使我的游戏模式在我的棋盘(人生游戏)上移动。此移动方法我目前已与字节[]。我想要做与ArrayList完全相同的方法。如何将我的byte []方法转换为arraylist []方法?
欢迎来到Stack Overflow!请[参观](http://stackoverflow.com/tour)以查看网站的工作原理和问题,并相应地编辑您的问题。另请参阅:[为什么“有人可以帮我吗?”不是一个实际的问题?](http://meta.stackoverflow.com/q/284236) –
为什么你想用'ArrayList'来解决什么? –