Hello all!
I got the following cod And I absolutley forgot how to get rid of breakse:
for (int xTemp = 0; xTemp < board.length; xTemp++) { if (board[xTemp][0] == curpos[0][0] && board[xTemp][1] == (curpos[0][1] + 66) || nopos[xTemp][0] == curpos[0][0] && nopos[xTemp][1] == (curpos[0][1] + 66)) { curpos[0][1] = curpos[0][1] + 66; repaint(); break; } }
More of crappy code with breaks:
for (xTemp = 0; xTemp < board.length; xTemp++) { // Rechts if ((isBoardPos(board[xTemp][0] + 66, board[xTemp][1]) == true) && (isEmptyPos(board[xTemp][0] + 66 * 2, board[xTemp][1]) == true)) { LOG("Is not lost"); rechts = true; break; } // Links else if ((isBoardPos(board[xTemp][0] - 66, board[xTemp][1]) == true) && (isEmptyPos(board[xTemp][0] - 66 * 2, board[xTemp][1]) == true)) { LOG("Is not lost"); links = true; break; } // Boven else if ((isBoardPos(board[xTemp][0], board[xTemp][1] + 66) == true) && (isEmptyPos(board[xTemp][0], board[xTemp][1] + 66 * 2) == true)) { LOG("Is not lost"); boven = true; break; } // Onder else if ((isBoardPos(board[xTemp][0], board[xTemp][1] - 66) == true) && (isEmptyPos(board[xTemp][0], board[xTemp][1] - 66 * 2) == true)) { LOG("Is not lost"); onder = true; break; } }
Thanks a lot for some help
Greetz!