Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 8, 2021 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/37b014d562fc42c9a26140e37023b5ca to your computer and use it in GitHub Desktop.
Save parzibyte/37b014d562fc42c9a26140e37023b5ca to your computer and use it in GitHub Desktop.
void leeCodigo(char matriz[LONGITUD][LONGITUD])
{
printf("Ingresa el codigo: ");
scanf("%c", &codigoGlobal);
char letra = 'A';
int y = 0, x = 0;
while (letra <= 'Z')
{
if (letra == codigoGlobal)
{
letra++;
}
// Comprobación extra para cuando el código es 'Z'
if (letra <= 'Z')
{
matriz[y][x] = letra;
}
x++;
letra++;
if (x >= LONGITUD)
{
x = 0;
y++;
}
if (y >= LONGITUD)
{
y = 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment