-
-
Save parzibyte/77267bb04664355d3e078746355201fe to your computer and use it in GitHub Desktop.
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
def todos_los_barcos_hundidos(matriz): | |
for y in range(FILAS): | |
for x in range(COLUMNAS): | |
celda = matriz[y][x] | |
# Si no es mar o un disparo, significa que todavía hay un barco por ahí | |
if celda != MAR and celda != DISPARO_ACERTADO and celda != DISPARO_FALLADO: | |
return False | |
# Acabamos de recorrer toda la matriz y no regresamos en la línea anterior. Entonces todos los barcos han sido hundidos | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment