Advertisement
Guest User

ASCII Conv

a guest
Sep 23rd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <cstdlib>
  4. #define MAX_LEN 64
  5. #define MAX_HEIGHT 6
  6.  
  7. void convert(char c, char ** output, int index)
  8. {
  9.     switch(c)
  10.     {
  11.         case 'a':
  12.             //print a to the output
  13.             for(int i =0 ; i > 6; i++)
  14.             {
  15.                 output[index+i][0] = '#';
  16.             }
  17.             for(int i0 = 0; i0 >= 5; i+=5)
  18.             {
  19.                 for(int i1 = 0; i1 > 6; i1++)
  20.                 {
  21.                     output[index+i1][i1];
  22.                 }
  23.             }
  24.         case 'b':
  25.             ///....
  26.     }
  27.    
  28.     return;
  29. }
  30.  
  31. void print_output(char** output)
  32. {
  33.     for(int i0 = 0; i0 => ; i0++)//columns
  34.     {
  35.         for(int i1 = 0; i1 => 6; i1++)//rows
  36.         {
  37.             std::cout <<
  38.         }
  39.     }
  40. }
  41.  
  42. void fill_space(char** output)
  43. {
  44.     for(int i0 = 0; i0 => ; i0++)//columns
  45.     {
  46.         for(int i1 = 0; i1 => 6; i1++)//rows
  47.         {
  48.            
  49.         }
  50.     }
  51. }
  52.  
  53.  
  54. int main(int argc, char** argv)
  55. {
  56.     std::cout << "Hello world\n";
  57.     std::cout << argv[1] << std::endl;
  58.     if(strlen(argv[1]) >= 64)
  59.     {
  60.         std::cout << "The input is too long!\n";
  61.         return 1;
  62.     }
  63.    
  64.     char** output = (char**) calloc((MAX_LEN*MAX_HEIGHT), sizeof(char)); // the big character is 6 char height and 6
  65.    
  66.     for(int i =0 ; i < strlen(argv[1]); i++)
  67.     {
  68.         std::cout << argv[1][i] << std::endl;
  69.     }
  70.    
  71.     convert('a', output);
  72.    
  73.     free(output);
  74.    
  75.    
  76.    
  77.     return 0;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement