Skip to content

Instantly share code, notes, and snippets.

@RhoKratos
Last active February 17, 2020 12:55
Show Gist options
  • Save RhoKratos/f84e1805c5d4caeeff363842a7d59bee to your computer and use it in GitHub Desktop.
Save RhoKratos/f84e1805c5d4caeeff363842a7d59bee to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main () {
int matriz [4][4]={{'_','*','_','*'},{'!','_','_','_'},{'*','_','*','*'},{'*','_','*','_'}};
int i,j;
int x,y;
int error=0;
while (error<3){
for (i=0; i<4; i++){
for (j=0; j<4; j++){
printf (" %c ", matriz [i][j]);
}
printf("\n");
}
//prueba de escritorio
printf("Coordenada en x, y: ");
scanf("%d,%d", &x,&y);
if(matriz[x][y]=='*');
matriz[x][y] ='!';
else{
error++;
matriz[x][y] = 'O';
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment