static int __BACKGROUND = LIGHTGREEN;
static int __FOREGROUND = LIGHTGRAY;
void posXY(int x, int y);
void textcolor (int color){
__FOREGROUND = color;
SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),
color + (__BACKGROUND << 4));}
int main(){
int x=10,y=10;
int A[7][7]={0,0,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0};
int B[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1,0};
int C[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0};
int D[7][7]={1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,1,1,1,1,1,0};
int E[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0};
int EP[7][7]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int F[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0};
int G[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1,0};
int H[7][7]={0,1,0,0,0,1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0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0};
int PF[7][7]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0};
int INT[7][7]={0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0};
char eterno='s';
char letra[50];
int i,j,k=0,cor,tam=0,tam2=0;
printf("entre com a letra\n");
fgets(letra,50,stdin);
cor=0;
textcolor(cor);
tam=strlen(letra);
tam2=tam*7;
printf("tam = %d e tam2 = %d",tam,tam2);
printf("\n");
while(eterno=='s'){
while(letra[k]!= '\0'){
Pergunta
Henrique S Medeiros
ate agora fiz isso , porem ele só imprimi verticalmente...
#include<stdio.h>
#include<string.h>
#include <windows.h>
#include <conio.h>
#include <ctype.h>
typedef enum{BLACK,BLUE,GREEN,CYAN,RED,MAGENTA,BROWN,LIGHTGRAY,DARKGRAY,
LIGHTBLUE,LIGHTGREEN,LIGHTCYAN,LIGHTRED,LIGHTMAGENTA,YELLOW,WHITE} COLORS;
static int __BACKGROUND = LIGHTGREEN;
static int __FOREGROUND = LIGHTGRAY;
void posXY(int x, int y);
void textcolor (int color){
__FOREGROUND = color;
SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),
color + (__BACKGROUND << 4));}
int main(){
int x=10,y=10;
int A[7][7]={0,0,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0};
int B[7][7]={0,1,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,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din);
cor=0;
textcolor(cor);
tam=strlen(letra);
tam2=tam*7;
printf("tam = %d e tam2 = %d",tam,tam2);
printf("\n");
while(eterno=='s'){
while(letra[k]!= '\0'){
if(letra[k]=='a'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(A[i][j]==0)
printf(" ");
if(A[x=i][j]==1)
printf("*");
printf("\n");
}
}
if(letra[k]=='b'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(B[i][j]==0)
printf(" ");
if(B[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='c'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(C[i][j]==0)
printf(" ");
if(C[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='d'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(D[i][j]==0)
printf(" ");
if(D[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='e'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(E[i][j]==0)
printf(" ");
if(E[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]==' '){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(EP[i][j]==0)
printf(" ");
if(EP[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='f'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(F[i][j]==0)
printf(" ");
if(F[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='g'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(G[i][j]==0)
printf(" ");
if(G[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='h'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(H[i][j]==0)
printf(" ");
if(H[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='i'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(I[i][j]==0)
printf(" ");
if(I[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='j'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(J[i][j]==0)
printf(" ");
if(J[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='k'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(K[i][j]==0)
printf(" ");
if(K[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='l'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(L[i][j]==0)
printf(" ");
if(L[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='m'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(M[i][j]==0)
printf(" ");
if(M[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='n'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(N[i][j]==0)
printf(" ");
if(N[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='o'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(O[i][j]==0)
printf(" ");
if(O[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='p'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(P[i][j]==0)
printf(" ");
if(P[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='q'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(Q[i][j]==0)
printf(" ");
if(Q[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='r'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(R[i][j]==0)
printf(" ");
if(R[i][j]==1)
printf("*");
}
printf("\n");
}
}
printf("\n");
if(letra[k]=='s'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(S[i][j]==0)
printf(" ");
if(S[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='t'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(T[i][j]==0)
printf(" ");
if(T[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='u'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(U[i][j]==0)
printf(" ");
if(U[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='v'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(V[i][j]==0)
printf(" ");
if(V[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='w'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(W[i][j]==0)
printf(" ");
if(W[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='x'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(X[i][j]==0)
printf(" ");
if(X[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='y'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(Y[i][j]==0)
printf(" ");
if(Y[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='z'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(Z[i][j]==0)
printf(" ");
if(Z[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='!'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(EX[i][j]==0)
printf(" ");
if(EX[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='.'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(PF[i][j]==0)
printf(" ");
if(PF[i][j]==1)
printf("*");
}
printf("\n");
}
}
if(letra[k]=='?'){
for(i=0;i<7;i++){
for(j=0;j<7;j++){
if(INT[i][j]==0)
printf(" ");
if(INT[i][j]==1)
printf("*");
}
printf("\n");
}
}
k++;
Sleep(500);
}
printf("\n");
k=0;
}
}
void posXY(int x, int y)
{
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),(COORD){x,y});
}
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.