Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <time.h>
- void gotoxy(int x, int y) {
- COORD c;
- c.X = x - 1;
- c.Y = y - 1;
- SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
- }
- int main(void)
- {
- char texto[12];
- int var;
- char letra[27][5][6]= {
- {
- {' ',' ',' ',' ',' ',' '}, //ESPAÇO
- {' ',' ',' ',' ',' ',' '},
- {' ',' ',' ',' ',' ',' '},
- {' ',' ',' ',' ',' ',' '},
- {' ',' ',' ',' ',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //A
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {'#','#','#','#',' ',' '}, //B
- {'#',' ',' ','#',' ',' '},
- {'#','#','#','#','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '}
- },
- {
- {'#','#','#','#','#',' '}, //C
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#','#','#','#','#',' '}
- },
- {
- {'#','#','#','#',' ',' '}, //D
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //E
- {'#',' ',' ',' ',' ',' '},
- {'#','#','#','#','#',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#','#','#','#','#',' '}
- },
- {
- {'#','#','#','#','#',' '}, //F
- {'#',' ',' ',' ',' ',' '},
- {'#','#','#',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //G
- {'#',' ',' ',' ',' ',' '},
- {'#',' ','#','#','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //H
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {' ',' ','#',' ',' ',' '}, //I
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //J
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {'#',' ','#',' ',' ',' '},
- {'#','#','#',' ',' ',' '}
- },
- {
- {'#',' ',' ','#',' ',' '}, //K
- {'#',' ','#',' ',' ',' '},
- {'#','#',' ',' ',' ',' '},
- {'#',' ','#',' ',' ',' '},
- {'#',' ',' ','#',' ',' '}
- },
- {
- {'#',' ',' ',' ',' ',' '}, //L
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#','#','#','#','#',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //M
- {'#','#',' ','#','#',' '},
- {'#',' ','#',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //N
- {'#','#',' ',' ','#',' '},
- {'#',' ','#',' ','#',' '},
- {'#',' ',' ','#','#',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {' ','#','#','#',' ',' '}, //O
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {' ','#','#','#',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //P
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '},
- {'#',' ',' ',' ',' ',' '},
- {'#',' ',' ',' ',' ',' '}
- },
- {
- {' ','#','#','#',' ',' '}, //Q
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {' ','#','#','#',' ',' '},
- {' ',' ',' ',' ','#',' '}
- },
- {
- {'#','#','#','#','#',' '}, //R
- {'#',' ',' ',' ','#',' '},
- {'#','#','#','#','#',' '},
- {'#',' ','#',' ',' ',' '},
- {'#',' ',' ','#','#',' '}
- },
- {
- {' ','#','#','#','#',' '}, //S
- {'#',' ',' ',' ',' ',' '},
- {' ','#','#','#',' ',' '},
- {' ',' ',' ',' ','#',' '},
- {'#','#','#','#',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //T
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //U
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {' ','#','#','#',' ',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //V
- {'#',' ',' ',' ','#',' '},
- {'#',' ',' ',' ','#',' '},
- {' ','#',' ','#',' ',' '},
- {' ',' ','#',' ',' ',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //W
- {'#',' ',' ',' ','#',' '},
- {'#',' ','#',' ','#',' '},
- {'#','#',' ','#','#',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //X
- {' ','#',' ','#',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ','#',' ','#',' ',' '},
- {'#',' ',' ',' ','#',' '}
- },
- {
- {'#',' ',' ',' ','#',' '}, //Y
- {' ','#',' ','#',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ',' ','#',' ',' ',' '}
- },
- {
- {'#','#','#','#','#',' '}, //Z
- {' ',' ',' ','#',' ',' '},
- {' ',' ','#',' ',' ',' '},
- {' ','#',' ',' ',' ',' '},
- {'#','#','#','#','#',' '}
- }};
- printf("Digite um texto de ate 40 caracteres.\n");
- gets(texto);
- var=strlen(texto);
- ;
- char resultado[5][6*var],caractere;
- int i;
- for (i=0; i<var ; i++)
- {
- if ((texto[i]<97 || texto[i]>122) && texto[i]!=32)
- {
- printf("Texto invalido.\n");
- return 0;
- }
- caractere=texto[i];
- int linha, coluna;
- for (linha=0 ; linha<5 ; linha++)
- {
- for (coluna=0 ; coluna<6 ; coluna++)
- {
- if (caractere!=32)
- {
- resultado[linha][coluna+i*6]=letra[caractere-96][linha][coluna];
- }
- else{resultado[linha][coluna+i*6]=letra[0][linha][coluna];}
- }
- }
- }
- int j,k;
- do
- {
- for(k=0 ; k<=var ; k++)
- {
- gotoxy(1,8);
- for(i=0 ; i<5 ; i++)
- {
- for(j=0 ; j<70 ; j++)
- {
- printf("%c",resultado[i][k+j]);
- }
- printf("\n");
- }
- sleep(100);
- system("cls");
- }
- }while(1==1);
- }
Add Comment
Please, Sign In to add comment