Basic hit detection

This commit is contained in:
2023-03-21 14:42:54 -07:00
parent 3a790e57c9
commit 978c420046
20 changed files with 343 additions and 41 deletions

View File

@ -71,16 +71,16 @@ int32_t Dawn::ticTacToeGetBoardScore(
uint8_t countEmpty = 0;
for (uint8_t j = 0; j < 3; j++) {
if (board[lines[i][j]] == player) {
if(board[lines[i][j]] == player) {
countPlayer++;
} else if (board[lines[i][j]] == TIC_TAC_TOE_EMPTY) {
} else if(board[lines[i][j]] == TIC_TAC_TOE_EMPTY) {
countEmpty++;
}
}
if (countPlayer == 2 && countEmpty == 1) {
if(countPlayer == 2 && countEmpty == 1) {
score += 10;
} else if (countPlayer == 1 && countEmpty == 2) {
} else if(countPlayer == 1 && countEmpty == 2) {
score += 1;
}
}