Basic hit detection
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user