-
-
Save parzibyte/8d7b3bf819bf283d62045d6fe9632b28 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
void codifica(char texto[MAXIMA_LONGITUD_CADENA], char matriz[LONGITUD][LONGITUD]) | |
{ | |
int longitud = longitudCadena(texto); | |
int x = 0; | |
while (x < longitud) | |
{ | |
char primera = texto[x]; | |
if (x + 1 < longitud) | |
{ | |
char segunda = texto[x + 1]; | |
if (primera != ' ' && segunda != ' ' && primera != codigoGlobal && segunda != codigoGlobal) | |
{ | |
char nuevaPrimera = remplazoPrimera(matriz, primera, segunda); | |
char nuevaSegunda = remplazoSegunda(matriz, primera, segunda); | |
texto[x] = nuevaPrimera; | |
texto[x + 1] = nuevaSegunda; | |
x++; | |
} | |
} | |
x++; | |
} | |
} | |
void decodifica(char texto[MAXIMA_LONGITUD_CADENA], char matriz[LONGITUD][LONGITUD]) | |
{ | |
// Se usa la misma función | |
codifica(texto, matriz); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment