示例#1
0
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;
}
示例#2
0
文件: target.c 项目: FISA-TW/Exploits
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;
}