This file contains 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
// Indica si el jugador gana | |
static boolean comprobarSiGana(char jugador, char[][] tablero) { | |
int y; | |
for (y = 0; y < FILAS; y++) { | |
int x; | |
for (x = 0; x < COLUMNAS; x++) { | |
if ( | |
contarHaciaArriba(x, y, jugador, tablero) >= CONTEO_PARA_GANAR || | |
contarHaciaDerecha(x, y, jugador, tablero) >= CONTEO_PARA_GANAR || | |
contarHaciaArribaDerecha(x, y, jugador, tablero) >= CONTEO_PARA_GANAR || | |
contarHaciaAbajoDerecha(x, y, jugador, tablero) >= CONTEO_PARA_GANAR) { | |
return true; | |
} | |
} | |
} | |
// Terminamos de recorrer y no conectó | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment