-
-
Save parzibyte/41379011579ba06fd82b3ace914b10b3 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
char solicitarDireccionDisparo(char bosque[medidaGlobalBosque][medidaGlobalBosque], char jugador) { | |
char direccion = DIRECCION_IZQUIERDA; | |
while (1) { | |
printf("%c - Arriba\n%c - Abajo\n%c - Derecha\n%c - Izquierda\nJugador %c. Ingrese la direccion para disparar: ", | |
DIRECCION_ARRIBA, DIRECCION_ABAJO, DIRECCION_DERECHA, DIRECCION_IZQUIERDA, jugador); | |
scanf("%c", &direccion); | |
consumir_nueva_linea(); | |
if (esDireccionValida(direccion)) { | |
return direccion; | |
} else { | |
printf("No puede disparar en esa direccion. Intente de nuevo\n"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment