void GameBoard::StartGame() { int cntTurn = 0; while (true) { PlayerTurn(); EnemyTurn(); cntTurn++; if (ChkEndGame() == true) break; DeleteDeadCards(); } printf("ÃÑ Play Turn : %d \n", cntTurn); }
int main() { while (true) { //initialize Randomize(); Set<string> wordsSeen; Lexicon lex("lexicon.dat"); Grid<string> board(4,4); //changes for 5x5 SetWindowSize(9, 5); InitGraphics(); DrawBoard(4,4); //changes for 5x5 Welcome(); GiveInstructions(); //either set up the board automatically or let the user set it up cout << "Would you like to configure the board? "; string response = GetLine(); response = ConvertToUpperCase(response); if (response == "YES") { UserConfigureBoard(board); } else { InitializeBoard(board); } //have the player play, then the computer PlayerTurn(board, lex, wordsSeen); ComputerTurn(board, lex, wordsSeen); //check if the user wants to play again cout << "Would you like to play again? "; response = GetLine(); response = ConvertToUpperCase(response); if (response != "YES") break; } return 0; }