Last active
February 17, 2020 12:55
-
-
Save RhoKratos/f84e1805c5d4caeeff363842a7d59bee 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
#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