-
-
Save parzibyte/c437760dcc0b8f159935f0a37059007e 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 solicitar_jugador() { | |
char jugador = ARQUERO_J1; | |
while (1) { | |
printf("%c - Arquero 1\n%c - Arquero 2. Seleccione quien empieza la partida: ", ARQUERO_J1, ARQUERO_J2); | |
scanf("%c", &jugador); | |
consumir_nueva_linea(); | |
if (jugador == ARQUERO_J1 || jugador == ARQUERO_J2) { | |
return jugador; | |
} else { | |
printf("Jugador incorrecto\n"); | |
} | |
} | |
} | |
char solicitar_eleccion(char jugador) { | |
char eleccion = ' '; | |
while (1) { | |
printf("%c - Mover\n%c - Disparar. Jugador %c seleccione una opcion: ", OPCION_MOVER, OPCION_DISPARAR, jugador); | |
scanf("%c", &eleccion); | |
consumir_nueva_linea(); | |
if (eleccion == OPCION_MOVER || eleccion == OPCION_DISPARAR) { | |
return eleccion; | |
} else { | |
printf("La opcion no es correcta\n"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment