Created
December 9, 2012 07:34
-
-
Save Hydrotoast/4243800 to your computer and use it in GitHub Desktop.
Anticipated Game Loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CppCKPlayer player = new CppCKPlayer(dllNameStr, playerInt, BoardModel model); | |
while (!game.isEnd()) { | |
// Opponent makes a move | |
Cell cell; | |
cell.row = opponentMove.row; | |
cell.col = opponentMove.col; | |
Mark m = (opponentMove.mark == 'X') ? Mark.A : Mark.B; | |
player.updateBoard(cell, mark); | |
Cell c = player.getMove(); | |
// Update game/model with c | |
} | |
player.dispose(); // IMPORTANT TO PREVENT MEMORY LEAKS! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment