Basic hit detection

This commit is contained in:
YourWishes committed 2023-03-21 14:42:54 -07:00
1 parent d7538ec3d3
commit 0be34af8dc
20 files changed
+343 -41

No files matched your search

+4 -4
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;
}
}