rod1231234

letreiro polina

Oct 23rd, 2011
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.80 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <windows.h>
  5. #include <time.h>
  6.  
  7.  
  8. void gotoxy(int x, int y) {
  9.     COORD c;
  10.     c.X = x - 1;
  11.     c.Y = y - 1;
  12.     SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
  13. }
  14.  
  15. int main(void)
  16. {
  17.    
  18.     char texto[12];
  19.     int var;
  20.     char letra[27][5][6]= {
  21.         {
  22.             {' ',' ',' ',' ',' ',' '}, //ESPAÇO
  23.             {' ',' ',' ',' ',' ',' '},
  24.             {' ',' ',' ',' ',' ',' '},
  25.             {' ',' ',' ',' ',' ',' '},
  26.             {' ',' ',' ',' ',' ',' '}
  27.         },
  28.         {
  29.             {'#','#','#','#','#',' '}, //A
  30.             {'#',' ',' ',' ','#',' '},
  31.             {'#','#','#','#','#',' '},
  32.             {'#',' ',' ',' ','#',' '},
  33.             {'#',' ',' ',' ','#',' '}
  34.            
  35.         },
  36.         {
  37.             {'#','#','#','#',' ',' '},  //B
  38.             {'#',' ',' ','#',' ',' '},
  39.             {'#','#','#','#','#',' '},
  40.             {'#',' ',' ',' ','#',' '},
  41.             {'#','#','#','#','#',' '}
  42.         },
  43.         {
  44.             {'#','#','#','#','#',' '},  //C
  45.             {'#',' ',' ',' ',' ',' '},
  46.             {'#',' ',' ',' ',' ',' '},
  47.             {'#',' ',' ',' ',' ',' '},
  48.             {'#','#','#','#','#',' '}
  49.         },
  50.         {
  51.             {'#','#','#','#',' ',' '},  //D
  52.             {'#',' ',' ',' ','#',' '},
  53.             {'#',' ',' ',' ','#',' '},
  54.             {'#',' ',' ',' ','#',' '},
  55.             {'#','#','#','#',' ',' '}
  56.         },
  57.         {
  58.             {'#','#','#','#','#',' '},  //E
  59.             {'#',' ',' ',' ',' ',' '},
  60.             {'#','#','#','#','#',' '},
  61.             {'#',' ',' ',' ',' ',' '},
  62.             {'#','#','#','#','#',' '}
  63.         },
  64.         {
  65.             {'#','#','#','#','#',' '},  //F
  66.             {'#',' ',' ',' ',' ',' '},
  67.             {'#','#','#',' ',' ',' '},
  68.             {'#',' ',' ',' ',' ',' '},
  69.             {'#',' ',' ',' ',' ',' '}
  70.         },
  71.         {
  72.             {'#','#','#','#','#',' '}, //G
  73.             {'#',' ',' ',' ',' ',' '},
  74.             {'#',' ','#','#','#',' '},
  75.             {'#',' ',' ',' ','#',' '},
  76.             {'#','#','#','#','#',' '}
  77.         },
  78.         {
  79.             {'#',' ',' ',' ','#',' '},  //H
  80.             {'#',' ',' ',' ','#',' '},
  81.             {'#','#','#','#','#',' '},
  82.             {'#',' ',' ',' ','#',' '},
  83.             {'#',' ',' ',' ','#',' '}
  84.         },
  85.         {
  86.             {' ',' ','#',' ',' ',' '},  //I
  87.             {' ',' ','#',' ',' ',' '},
  88.             {' ',' ','#',' ',' ',' '},
  89.             {' ',' ','#',' ',' ',' '},
  90.             {' ',' ','#',' ',' ',' '}
  91.         },
  92.         {
  93.             {'#','#','#','#','#',' '},  //J
  94.             {' ',' ','#',' ',' ',' '},
  95.             {' ',' ','#',' ',' ',' '},
  96.             {'#',' ','#',' ',' ',' '},
  97.             {'#','#','#',' ',' ',' '}
  98.         },
  99.         {
  100.             {'#',' ',' ','#',' ',' '},  //K
  101.             {'#',' ','#',' ',' ',' '},
  102.             {'#','#',' ',' ',' ',' '},
  103.             {'#',' ','#',' ',' ',' '},
  104.             {'#',' ',' ','#',' ',' '}
  105.         },
  106.         {
  107.             {'#',' ',' ',' ',' ',' '}, //L
  108.             {'#',' ',' ',' ',' ',' '},
  109.             {'#',' ',' ',' ',' ',' '},
  110.             {'#',' ',' ',' ',' ',' '},
  111.             {'#','#','#','#','#',' '}
  112.         },
  113.         {
  114.             {'#',' ',' ',' ','#',' '}, //M
  115.             {'#','#',' ','#','#',' '},
  116.             {'#',' ','#',' ','#',' '},
  117.             {'#',' ',' ',' ','#',' '},
  118.             {'#',' ',' ',' ','#',' '}
  119.         },
  120.         {
  121.             {'#',' ',' ',' ','#',' '},  //N
  122.             {'#','#',' ',' ','#',' '},
  123.             {'#',' ','#',' ','#',' '},
  124.             {'#',' ',' ','#','#',' '},
  125.             {'#',' ',' ',' ','#',' '}
  126.         },
  127.         {
  128.             {' ','#','#','#',' ',' '},  //O
  129.             {'#',' ',' ',' ','#',' '},
  130.             {'#',' ',' ',' ','#',' '},
  131.             {'#',' ',' ',' ','#',' '},
  132.             {' ','#','#','#',' ',' '}
  133.         },
  134.         {
  135.             {'#','#','#','#','#',' '}, //P
  136.             {'#',' ',' ',' ','#',' '},
  137.             {'#','#','#','#','#',' '},
  138.             {'#',' ',' ',' ',' ',' '},
  139.             {'#',' ',' ',' ',' ',' '}
  140.         },
  141.         {
  142.             {' ','#','#','#',' ',' '},  //Q
  143.             {'#',' ',' ',' ','#',' '},
  144.             {'#',' ',' ',' ','#',' '},
  145.             {' ','#','#','#',' ',' '},
  146.             {' ',' ',' ',' ','#',' '}
  147.         },
  148.         {
  149.             {'#','#','#','#','#',' '}, //R
  150.             {'#',' ',' ',' ','#',' '},
  151.             {'#','#','#','#','#',' '},
  152.             {'#',' ','#',' ',' ',' '},
  153.             {'#',' ',' ','#','#',' '}
  154.         },
  155.         {
  156.             {' ','#','#','#','#',' '}, //S
  157.             {'#',' ',' ',' ',' ',' '},
  158.             {' ','#','#','#',' ',' '},
  159.             {' ',' ',' ',' ','#',' '},
  160.             {'#','#','#','#',' ',' '}
  161.         },
  162.         {
  163.             {'#','#','#','#','#',' '},  //T
  164.             {' ',' ','#',' ',' ',' '},
  165.             {' ',' ','#',' ',' ',' '},
  166.             {' ',' ','#',' ',' ',' '},
  167.             {' ',' ','#',' ',' ',' '}
  168.         },
  169.         {
  170.             {'#',' ',' ',' ','#',' '},  //U
  171.             {'#',' ',' ',' ','#',' '},
  172.             {'#',' ',' ',' ','#',' '},
  173.             {'#',' ',' ',' ','#',' '},
  174.             {' ','#','#','#',' ',' '}
  175.         },
  176.         {
  177.             {'#',' ',' ',' ','#',' '},  //V
  178.             {'#',' ',' ',' ','#',' '},
  179.             {'#',' ',' ',' ','#',' '},
  180.             {' ','#',' ','#',' ',' '},
  181.             {' ',' ','#',' ',' ',' '}
  182.         },
  183.         {
  184.             {'#',' ',' ',' ','#',' '},  //W
  185.             {'#',' ',' ',' ','#',' '},
  186.             {'#',' ','#',' ','#',' '},
  187.             {'#','#',' ','#','#',' '},
  188.             {'#',' ',' ',' ','#',' '}
  189.         },
  190.         {
  191.             {'#',' ',' ',' ','#',' '},  //X
  192.             {' ','#',' ','#',' ',' '},
  193.             {' ',' ','#',' ',' ',' '},
  194.             {' ','#',' ','#',' ',' '},
  195.             {'#',' ',' ',' ','#',' '}
  196.         },
  197.         {
  198.             {'#',' ',' ',' ','#',' '},  //Y
  199.             {' ','#',' ','#',' ',' '},
  200.             {' ',' ','#',' ',' ',' '},
  201.             {' ',' ','#',' ',' ',' '},
  202.             {' ',' ','#',' ',' ',' '}
  203.         },
  204.         {
  205.             {'#','#','#','#','#',' '},  //Z
  206.             {' ',' ',' ','#',' ',' '},
  207.             {' ',' ','#',' ',' ',' '},
  208.             {' ','#',' ',' ',' ',' '},
  209.             {'#','#','#','#','#',' '}
  210.         }};
  211.     char oi[60]="          "; //muda a variavel ae...
  212.     printf("Digite um texto de ate 40 caracteres.\n");
  213.     gets(texto);
  214.     var=strlen(texto);
  215.     strcat(oi,texto)
  216.     strcat(oi,"          ");
  217.     for(i=0;i<var+20;i++)
  218.     {
  219.         texto[i]=oi[i];
  220.     }
  221.     char resultado[5][(6*var)+20],caractere;
  222.     int i;
  223.    
  224.     for (i=0; i<(var+20) ; i++)
  225.     {
  226.         if ((texto[i]<97 || texto[i]>122) && texto[i]!=32)
  227.         {
  228.             printf("Texto invalido.\n");
  229.             return 0;
  230.         }
  231.        
  232.         caractere=texto[i];
  233.        
  234.         int linha, coluna;
  235.        
  236.         for (linha=0 ; linha<5 ; linha++)
  237.         {
  238.             for (coluna=0 ; coluna<6 ; coluna++)
  239.             {
  240.                 if (caractere!=32)
  241.                 {
  242.                     resultado[linha][coluna+i*6]=letra[caractere-96][linha][coluna];
  243.                 }
  244.                 else{resultado[linha][coluna+i*6]=letra[0][linha][coluna];}
  245.             }
  246.         }
  247.        
  248.        
  249.        
  250.     }
  251.    
  252.     int j,k,y;
  253.    
  254.     for(y=1;y>0;y++)
  255.     {
  256.         for(k=0 ; k<=var ; k++)
  257.         {
  258.             for(i=0 ; i<5 ; i++)
  259.             {
  260.                 for(j=0 ; j<60 ; j++)
  261.                 {
  262.                     printf("%c",resultado[i][k+j]);
  263.                    
  264.                    
  265.                 }
  266.                 printf("\n");
  267.                
  268.             }
  269.            
  270.             sleep(100);
  271.             system("cls");
  272.         }
  273.     }
  274. }
  275.  
Advertisement
Add Comment
Please, Sign In to add comment