337 lines
6.0 KiB
C++
337 lines
6.0 KiB
C++
#include<stdio.h>
|
|
#include<math.h>
|
|
#include<graphics.h>
|
|
#include<conio.h>
|
|
#include<dos.h>
|
|
#include<ctype.h>
|
|
#include<string.h>
|
|
#define k (2*3.14159/360)
|
|
char texto/*[1]*/[100]={" ESTO ES UNA PRUEBA DEL TAMA¥O DE CADENA "};
|
|
int letras[29][56]={
|
|
//espacio en blanco
|
|
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,0,0,0,0,0,0,0,
|
|
// la A
|
|
0,0,0,1,1,0,0,0,
|
|
0,0,1,1,1,1,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,1,1,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
// la B
|
|
1,1,1,1,1,1,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,1,1,1,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
1,1,1,1,1,1,0,0,
|
|
// la C
|
|
0,0,1,1,1,1,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
1,1,0,0,0,0,0,0,
|
|
1,1,0,0,0,0,0,0,
|
|
1,1,0,0,0,0,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,0,1,1,1,1,0,0,
|
|
// la D
|
|
1,1,1,1,1,0,0,0,
|
|
0,1,1,0,1,1,0,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,1,1,0,0,
|
|
1,1,1,1,1,0,0,0,
|
|
// la E
|
|
1,1,1,1,1,1,1,0,
|
|
0,1,1,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|
|
1,1,0,0,0,1,1,0,
|
|
0,1,1,0,1,1,0,0,
|
|
0,0,1,1,1,0,0,0,
|
|
0,0,1,1,1,0,0,0,
|
|
0,1,1,0,1,1,0,0,
|
|
1,1,0,0,0,1,1,0,
|
|
1,1,0,0,0,1,1,0,
|
|
// la Y
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
0,0,1,1,1,1,0,0,
|
|
0,0,0,1,1,0,0,0,
|
|
0,0,0,1,1,0,0,0,
|
|
0,0,1,1,1,1,0,0,
|
|
// la Z
|
|
1,1,1,1,1,1,1,0,
|
|
1,1,0,0,0,1,1,0,
|
|
0,0,0,0,1,1,0,0,
|
|
0,0,0,1,1,0,0,0,
|
|
0,0,1,1,0,0,1,0,
|
|
0,1,1,0,0,1,1,0,
|
|
1,1,1,1,1,1,1,0,
|
|
};
|
|
|
|
void muevel();
|
|
void main()
|
|
{
|
|
int gdriver=DETECT,gmode;
|
|
initgraph(&gdriver,&gmode,"");
|
|
muevel();
|
|
closegraph();
|
|
}
|
|
|
|
//funcion que mueve letras
|
|
void muevel()
|
|
{
|
|
// a para los 360 y para vertical y matriz
|
|
// x1 para posicion x
|
|
// y1 para posicion y
|
|
// v calcula seno
|
|
// i1 incrementa x1
|
|
// c1 vuelve a posicionar
|
|
int V;
|
|
int a=0,x=0,y=0,c1=640,ac1=c1;
|
|
int finali=8,c=0,i=0,c3=0;
|
|
int r=0,i1=0,ac3=0,c4=0;
|
|
int n[100],l;
|
|
l=strlen(texto/*[0]*/);
|
|
//lee letras y las pone a numeros
|
|
for(a=0;a<l;a++)
|
|
{
|
|
if(toascii(texto/*[0]*/[a]-65)<14)
|
|
n[a]=toascii(texto/*[0]*/[a]-64);
|
|
else if(texto/*[0]*/[a]=='¥')
|
|
n[a]=15;
|
|
else if(texto/*[0]*/[a]==' ')
|
|
n[a]=0;
|
|
else
|
|
n[a]=toascii(texto/*[0]*/[a]-63);
|
|
}
|
|
while(c3!=l && !kbhit() )
|
|
{
|
|
|
|
//dibuja letras
|
|
while(y<70)
|
|
{
|
|
if(c3<l)
|
|
{
|
|
if(letras[n[c3]][i]==1) setcolor(10);
|
|
else setcolor(0);
|
|
}
|
|
V =50*sin(x*k);
|
|
outtextxy(x+V,200 + y+V,"*");
|
|
if(x>=c1||c1<0) {i++;}
|
|
if(i==finali) {i=finali-8;c3++;}
|
|
x=x+10;
|
|
if(x==640)
|
|
{
|
|
c1=ac1;x=0;y=y+10;c3=ac3;c=c+8;i=c+i1;finali=c+8;}
|
|
}
|
|
|
|
//cosas
|
|
x=0;y=0;
|
|
//matriz i
|
|
finali=8;
|
|
//linea
|
|
i=0;
|
|
//cada linea
|
|
c=0;
|
|
//rota paleta
|
|
delay(10);
|
|
c1=c1-10;
|
|
|
|
ac1=c1;
|
|
//condicion
|
|
|
|
if(c1<0)
|
|
{
|
|
i1=0;
|
|
//recalcula
|
|
if(c1>-640)
|
|
r=10;
|
|
else
|
|
r=abs(c1)-640;
|
|
while(y<r)
|
|
{
|
|
i++;
|
|
if(i==finali) {i=finali-8;c3++;}
|
|
x=x+10;
|
|
if(x==640)
|
|
{c1=ac1;x=0;y=y+10;c3=ac3;c=c+8;i=c+i1;finali=c+8;}
|
|
if(x==abs(c1)) break;
|
|
}
|
|
c4++;
|
|
}
|
|
if(c4==8) {c4=0;ac3++;ac1=0;}
|
|
y=0;x=0;
|
|
i1=i;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|