Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. /// Al-Bhed to English program
  5. //  Created by Samuel Vargas
  6. //  Public Domain
  7.  
  8.  
  9. char convert(char z_type, char z_string)
  10. {
  11.   char english[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  12.   char albhed[]  = "EPSTIWKNUVGCLRYBWHMDOFXQAG";
  13.    
  14.     int a;
  15.     int b;
  16.     int c;
  17.     int z_match_numb;
  18.     char *z_result;
  19.     c = 0;
  20.     if (z_type == 'A')
  21.         for (a = 0; a < albhed[a]; a++)
  22.             {
  23.                 c++
  24.                 if (z_string[a] == albhed[a])
  25.                 {
  26.                     c = z_match_numb;
  27.                     break;
  28.                 }
  29.   /// D is the number that corresponds to
  30.   /// the translated character.
  31. }
  32.  
  33. int main(int ac, char **av)
  34. {
  35.   char z_type;
  36.   char *z_string;
  37.   int b;
  38.   char *z;
  39.  
  40.   if (ac < 2)
  41.     printf("Program takes two arguments");
  42.  
  43.     z_type = av[1][0];
  44.         printf("%c is the z_type\n", z_type);
  45.     if (z_type != 'A' && z_type != 'E')
  46.         printf("See usage");
  47.  
  48.  
  49.     for (b = 2; b < ac; b++)
  50.         strcat(z_string, av[b]);
  51.     printf("%s\n", z_string);
  52.  
  53.  
  54.   z = convert(z_type, z_string);
  55.   printf("%s\n", z);
  56.  
  57.  return 0;
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement