這種方法的目的是,我擁有一個充滿泡泡的對象二維數組,我竟將陣列中的一切不爲0的顏色值下來,離開列頂部的顏色爲0。
目前它變成每一個現場與我想的是我在想念一個小邏輯錯誤一個0值的泡沫,但我一直在努力,現在爲3天,無法看到我的問題。 *澄清:myBoard初始化爲新的Bubble [15] [15];與泡沫構造函數(INT顏色,詮釋行,詮釋山口)換擋部件以特定方式
public void shiftBoardDown() {
int currentC = 0;
while(currentC < 15){
Bubble [] temp = new Bubble [15];
int hits = 14;
for(int i = 14; i <= 0; i--){
if(this.myBoard[i][currentC].getColor() != 0){
temp[hits] = new Bubble(this.myBoard[i][currentC].getColor(), hits, currentC);
hits--;
}
}
while(hits >= 0){
temp[hits] = new Bubble(0, hits, currentC);
hits--;
}
for(int r = 0; r < 15; r++){
this.myBoard[r][currentC] = temp[r];
}
currentC++;
}
}
這是什麼語言?適當標記問題。 – deceze