Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- /// Al-Bhed to English program
- // Created by Samuel Vargas
- // Public Domain
- char convert(char z_type, char z_string)
- {
- char english[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- char albhed[] = "EPSTIWKNUVGCLRYBWHMDOFXQAG";
- int a;
- int b;
- int c;
- int z_match_numb;
- char *z_result;
- c = 0;
- if (z_type == 'A')
- for (a = 0; a < albhed[a]; a++)
- {
- c++
- if (z_string[a] == albhed[a])
- {
- c = z_match_numb;
- break;
- }
- /// D is the number that corresponds to
- /// the translated character.
- }
- int main(int ac, char **av)
- {
- char z_type;
- char *z_string;
- int b;
- char *z;
- if (ac < 2)
- printf("Program takes two arguments");
- z_type = av[1][0];
- printf("%c is the z_type\n", z_type);
- if (z_type != 'A' && z_type != 'E')
- printf("See usage");
- for (b = 2; b < ac; b++)
- strcat(z_string, av[b]);
- printf("%s\n", z_string);
- z = convert(z_type, z_string);
- printf("%s\n", z);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement