bool board_2048::gameEnded() { bool ended = true; if(winGame()) { ui->curScore->setText("WIN"); return ended; } if (countEmpty() > 0) { return false; } if (findPairDown()) { return false; } transpose(); if (findPairDown()) { ended = false; } transpose(); transpose(); transpose(); if(ended==true) ui->curScore->setText("END"); return ended; }
bool gameEnded(uint8_t board[SIZE][SIZE]) { bool ended = true; if (countEmpty(board)>0) return false; if (findPairDown(board)) return false; rotateBoard(board); if (findPairDown(board)) ended = false; rotateBoard(board); rotateBoard(board); rotateBoard(board); return ended; }