-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'來解決什麼? –