altra diagonale

This commit is contained in:
Lorenzo Bianchi 2023-05-15 16:36:47 +02:00
parent 89435cd0b1
commit b6e63ca240
1 changed files with 3 additions and 3 deletions

View File

@ -47,9 +47,9 @@ int checkWin(tile_t *board, int x, int y, int rows, int collums) {
for (i=0; i<4; i++) {
if (y + i - 3 >= 0 && y + i < rows && x + i - 3 >= 0 && x + i < collums) {
if (board[x - 3 + i + (y + i - 3) * collums] == board[x + i + (y + i) * collums] &&
board[x - 2 + i + (y + i - 2) * collums] == board[x + i + (y + i) * collums] &&
board[x - 1 + i + (y + i - 1) * collums] == board[x + i + (y + i) * collums]) {
if (board[x - 3 + i + (y - i + 3) * collums] == board[x + i + (y + i) * collums] &&
board[x - 2 + i + (y - i + 2) * collums] == board[x + i + (y + i) * collums] &&
board[x - 1 + i + (y - i + 1) * collums] == board[x + i + (y + i) * collums]) {
return current;
}