Hola estoy haciendo una simulacion de un cartel. el detalle que tengo es que debo utilizar memoria dinamica en la frase de mi cartel publicitario, pero no se como implementarla. Y tengo que quitar unas cientos de variables globales, ya que milinda profesora de algoritmos esta en contra de ellas. Pero el problema es que no se donde moverle a mi programa.
aqui les dejo el codigo, por favor ayudenme ya que es mi proyecto final y no se que hacer por que lo tengo que entregar el unes 25 de mayo a las 4:30pm hora de mexico.
#include <conio.h>
#include <stdio.h>
#include <dos.h>
#include <graphics.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
// char texto1[70];
//int cf=8,ct=15;
//int MOVIMIENTO;
//int M[9][520];
//int FRASE=0;
//int G=0;
struct registro
{
char nombre[8];
char frase[65];
int colorfondo;
int colortexto;
int efecto;
} R ;
void inicializa()
{
int gd,gm;
gd=DETECT;
initgraph(&gd,&gm,"c:\tc\bgi");
}
void presentacion()
{
int grad;
clearviewport();
setfillstyle(5,1);
bar(0, 0, 639 ,479);delay(500);
setfillstyle(10,10);
grad=0;
do
{ clearviewport();
setfillstyle(11,10);
pieslice(320,220,0,grad,60);
delay(10);
grad+=5;
}while(grad<=360);
do
{
clearviewport();
setfillstyle(4,10);
pieslice(320,220,0,grad,60);
delay(10);
grad-=5;
}while(grad>=0);
grad=360;
clearviewport();
settextstyle(7,0,5);
setcolor(4);
outtextxy(100, 200, "CARTEL PUBLICITARIO");
setfillstyle(5,1);
bar(0, 0, 639 ,479);delay(500);
outtextxy(95, 200, "CARTEL PUBLICITARIO");
settextstyle(2,0,5);
setcolor(2);
outtextxy( 200, 400, "REALIZADO POR LOL-TUN GARCIA");delay(200);
outtextxy( 200, 400, "REALIZADO POR LOL-TUN GARCIA");delay(1000);
getch();
clearviewport();
}
void box(int x1,int y1,int x2,int y2, int relleno, int color)
{
int poly[8];
poly[0]=x1;
poly[1]=y1;
poly[2]=x2;
poly[3]=y1;
poly[4]=x2;
poly[5]=y2;
poly[6]=x1;
poly[7]=y2;
setfillstyle(relleno,color);
fillpoly(4,poly);
}
void foco(int x,int y,int r, int relleno, int color,int col)
{
fillellipse(x,y,r,r);
setfillstyle(relleno,color);
setcolor(col);
}
void pintar() //LEE EL TEXTO
{ int i,j,x,y,cf=8,ct=15,M[9][520];
for(x=12,i=0;x<625;x=x+12,i++)
for(y=286,j=0;y<383;y=y+12,j++)
{ if(M[j]<em>==1)
{ foco(x,y,5,1,ct,ct); }
if (M[j]<em>==0)
{ foco(x,y,5,1,cf,cf); }
} settextstyle(11,0,2);
}
void cartel() //LEE EL TEXTO
{ int i,j,x,y,cf=8,ct=15, M[9][520];
char texto1[70];
setcolor(ct); box(535,230,545,240,1,ct);
setcolor(cf); box(535,250,545,260,1,cf);
setcolor(cf); box(1,437,getmaxx(),451,1,cf);
setcolor(ct); settextstyle(11,0,2); outtextxy(20,440,texto1);
setcolor(cf);
for(i=0;i<520;i++)
for(j=0;j<9;j++)
{ M[j]<em>=0;}
for(i=0;i<520;i++)
for(j=0;j<9;j++)
{ if(getpixel(20+i,440+j)==ct)
{ M[j]<em>=1; }
if (getpixel(20+i,440+j)==cf)
{ M[j]<em>=0; }
}
pintar();
}
int caracteres()
{
int n,num;
char texto1[70];
num=strlen(texto1)*8;
return(num);
}
void mover() //ESKOGE MOVIMIENTO
{ int i,j,r=0,t,x,y,m=0,cf=8,ct=15,MOVIMIENTO,tecla,M[9][520],FRASE;
setcolor(7); box(100,43,400,190,1,7);
if (FRASE==0)
{ setcolor(13);box(135,215,315,255,1,13);
setcolor(15); box(135,216,314,225,1,15);
setcolor(15); settextstyle(12,0,5);
outtextxy(140,234,"FAVOR DE INTRODUCIR FRASE");
delay(1140); setcolor(7); box(135,215,315,255,1,7);
settextstyle(11,0,2);
}
if (FRASE==1)
{
if (MOVIMIENTO==1)
{
do{
for(x=12,i=1;x<625;x=x+12,i++)
for(y=286,j=0;y<383,j<9;y=y+12,j++)
{ if(M[j][i+m-52]==1)
{ foco(x,y,5,1,ct,ct);} //Pinta letra
if(M[j][i+m-52]==0)
{ foco(x,y,5,1,cf,cf);} //Pinta fondo
}m=m+1;
if (m>caracteres()+52)
{ m=0; }
} while(!kbhit());
}
if (MOVIMIENTO==2)
{
do{
for(x=12,i=caracteres();x<625;x=x+12,i++)
for(y=286,j=0;y<383,j<9;y=y+12,j++)
{ if(M[j][i-m]==1)
{ foco(x,y,5,1,ct,ct);} //Pinta letra
if(M[j][i-m]==0)
{ foco(x,y,5,1,cf,cf); //Pinta fondo
}
}m=m+1;
if (m>caracteres()+52)
m=0;
} while(!kbhit());
}
if (MOVIMIENTO==3)
{
do{
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[0]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[1]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[2]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[3]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[4]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[5]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,382,5,1,cf,cf);}
}
delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[6]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[7]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[8]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,382,5,1,cf,cf);}
} } while(!kbhit());
}
if (MOVIMIENTO==4)
{
do{
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[0]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[8]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[7]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[6]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[5]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[4]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,382,5,1,cf,cf);}
}
delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[3]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[2]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[1]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,382,5,1,cf,cf);}
} delay(900);
for(x=12,i=0;x<620;x=x+12,i++)
{
if(M[1]<em>==1) { foco(x,286,5,1,ct,ct);}if(M[1]<em>==0) {
foco(x,286,5,1,cf,cf);}
if(M[2]<em>==1) { foco(x,298,5,1,ct,ct);}if(M[2]<em>==0) {
foco(x,298,5,1,cf,cf);}
if(M[3]<em>==1) { foco(x,310,5,1,ct,ct);}if(M[3]<em>==0) {
foco(x,310,5,1,cf,cf);}
if(M[4]<em>==1) { foco(x,322,5,1,ct,ct);}if(M[4]<em>==0) {
foco(x,322,5,1,cf,cf);}
if(M[5]<em>==1) { foco(x,334,5,1,ct,ct);}if(M[5]<em>==0) {
foco(x,334,5,1,cf,cf);}
if(M[6]<em>==1) { foco(x,346,5,1,ct,ct);}if(M[6]<em>==0) {
foco(x,346,5,1,cf,cf);}
if(M[7]<em>==1) { foco(x,358,5,1,ct,ct);}if(M[7]<em>==0) {
foco(x,358,5,1,cf,cf);}
if(M[8]<em>==1) { foco(x,370,5,1,ct,ct);}if(M[8]<em>==0) {
foco(x,370,5,1,cf,cf);}
if(M[0]<em>==1) { foco(x,382,5,1,ct,ct);}if(M[0]<em>==0) {
foco(x,382,5,1,cf,cf);}
}
} while(!kbhit());
}}}
void frase() //CAPTURAR LA FRASE
{
char tecla, texto1[70];
int pos,n,i,j,k,m,x,cf,ct,FRASE=0,G;
G=0;
texto1[0]='x0';
ct=15; cf=8;
setcolor(ct); box(535,230,545,240,1,ct);
setcolor(cf); box(535,250,545,260,1,cf);
setcolor(7); box(0,280,getmaxx(),getmaxy(),1,7);
setcolor(7); box(90,415,550,450,1,7);
setcolor(9); box(10,420,611,465,1,5); box(15,435,545,455,1,10);
setcolor(9); settextstyle(11,0,2);
outtextxy(20,425,"INTRODUCIR FRASE= ");
do{
setcolor(5); outtextxy(20,440,texto1);
tecla=getch();
if(isprint(tecla)|| tecla==' ')
{
pos=strlen(texto1);
texto1[pos]= tecla;
texto1[pos+1]='x0';
}
if (tecla=='x8')
{
setcolor(10);
outtextxy(20,440,texto1);
pos=strlen(texto1);
texto1[pos-1]='x0';
}
pos=strlen(texto1);
if( tecla=='x1B')
{
tecla='xD';ct=7; cf=7;
}
} while (tecla!='xD');
setcolor(7); box(0,280,getmaxx(),getmaxy(),1,7);
setcolor(cf);box(1,437,getmaxx(),451,1,cf);
setcolor(ct);settextstyle(11,0,2);outtextxy(20,440,texto1);
FRASE=1;
cartel();
}
void fondo()
{
int i,c,a,b,d;
a=1; b=9; c=11;
setfillstyle(1,15); bar(420,50,635,125);
setcolor(9); outtextxy(425,58,"SELECIONA PARA FONDO");
setcolor(3);
for (i=430;i<610;i=i+25)
{ setfillstyle(1,a);
bar(i,70,i+20,90); a++;}
for (i=430;i<610;i=i+25)
{ setfillstyle(1,b);
bar(i,95,i+20,115);b++;}
setcolor(BLACK); rectangle(580,95,600,115);
}
void moverfondo() //ESCOGER COLOR PARA FONDO.
{
char tecla;
int i=1,FRASE=0, cf=8,ct=15;
fondo();
do{
switch(i)
{
case 1: setcolor(15); box(430,70,450,90,1,1); break;
case 2: setcolor(15); box(455,70,475,90,1,2); break;
case 3: setcolor(15); box(480,70,500,90,1,3); break;
case 4: setcolor(15); box(505,70,525,90,1,4); break;
case 5: setcolor(15); box(530,70,550,90,1,5); break;
case 6: setcolor(15); box(555,70,575,90,1,6); break;
case 7: setcolor(15); box(580,70,600,90,1,7); break;
case 8: setcolor(15); box(605,70,625,90,1,8); break;
case 9: setcolor(15); box(430,95,450,115,1,9); break;
case 10: setcolor(15); box(455,95,475,115,1,10); break;
case 11: setcolor(15); box(480,95,500,115,1,11); break;
case 12: setcolor(15); box(505,95,525,115,1,12); break;
case 13: setcolor(15); box(530,95,550,115,1,13); break;
case 14: setcolor(15); box(555,95,575,115,1,14); break;
case 15: setcolor(14); box(580,95,600,115,1,15); break;
case 16: setcolor(15); box(605,95,625,115,1,16); break;
} // fin azul9
tecla=getch();
switch(i){
case 1: setcolor(1); box(430,70,450,90,1,1); break;
case 2: setcolor(2); box(455,70,475,90,1,2); break;
case 3: setcolor(3); box(480,70,500,90,1,3); break;
case 4: setcolor(4); box(505,70,525,90,1,4); break;
case 5: setcolor(5); box(530,70,550,90,1,5); break;
case 6: setcolor(6); box(555,70,575,90,1,6); break;
case 7: setcolor(7); box(580,70,600,90,1,7); break;
case 8: setcolor(8); box(605,70,625,90,1,8); break;
case 9: setcolor(9); box(430,95,450,115,1,9); break;
case 10: setcolor(10); box(455,95,475,115,1,10); break;
case 11: setcolor(11); box(480,95,500,115,1,11); break;
case 12: setcolor(12); box(505,95,525,115,1,12); break;
case 13: setcolor(13); box(530,95,550,115,1,13); break;
case 14: setcolor(14); box(555,95,575,115,1,14); break;
case 15: setcolor(16); box(580,95,600,115,1,15); break;
case 16: setcolor(16); box(605,95,625,115,1,16); break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x4d' : i++;break;
case 'x4b' : i--; break;
}
if (i>16) i=1;
if (i<1) i=16;
break; //fin cero
case 'xD':
if (FRASE==0)
{
setcolor(2);box(135,215,315,255,1,11);
setcolor(7); box(136,216,314,224,1,13);
setcolor(9); settextstyle(12,0,5);
outtextxy(140,234,"INTRODUCIR UNA FRACE!");
delay(1000); setcolor(4); box(135,215,315,255,1,7);
settextstyle(11,0,2);
}
else{
switch(i)
{ case 1: cf=1; cartel(); break;
case 2: cf=2; cartel(); break;
case 3: cf=3; cartel(); break;
case 4: cf=4; cartel(); break;
case 5: cf=5; cartel(); break;
case 6: cf=6; cartel(); break;
case 7: cf=7; cartel(); break;
case 8: cf=8; cartel(); break;
case 9: cf=9; cartel(); break;
case 10: cf=10; cartel(); break;
case 11: cf=11; cartel(); break;
case 12: cf=12; cartel(); break;
case 13: cf=13; cartel(); break;
case 14: cf=14; cartel(); break;
case 15: cf=15; cartel(); break;
case 16: cf=16; cartel(); break;
}
break; //fin enter
}//fin tecla
} } while(tecla!= 'x1B');
if (tecla='x1B') setcolor(7); box(100,43,400,190,1,7);
}
void texto()
{ int i,a,b;
a=1;
b=9;
setfillstyle(1,15);
bar(420,140,635,210);
setcolor(9); outtextxy(430,143,"SELECCIONA PARA TEXTO");
setcolor(3);
for (i=430;i<610;i=i+25)
{ setfillstyle(1,a);
bar(i,160,i+20,180);
a++;}
for (i=430;i<610;i=i+25)
{ setfillstyle(1,b);
bar(i,185,i+20,205);b++;
}
setcolor(16); rectangle(580,185,600,205);
}
void movertexto() //ESCOGER COLOR PARA TEXTO.
{
char tecla;
int i=1, FRASE=0,cf=8, ct=15 ;
texto();
do{
switch(i)
{
case 1: setcolor(15); box(430,160,450,180,1,1); break;
case 2: setcolor(15); box(455,160,475,180,1,2); break;
case 3: setcolor(15); box(480,160,500,180,1,3); break;
case 4: setcolor(15); box(505,160,525,180,1,4); break;
case 5: setcolor(15); box(530,160,550,180,1,5); break;
case 6: setcolor(15); box(555,160,575,180,1,6); break;
case 7: setcolor(15); box(580,160,600,180,1,7); break;
case 8: setcolor(15); box(605,160,625,180,1,8); break;
case 9: setcolor(15); box(430,185,450,205,1,9); break;
case 10: setcolor(15); box(455,185,475,205,1,10); break;
case 11: setcolor(15); box(480,185,500,205,1,11); break;
case 12: setcolor(15); box(505,185,525,205,1,12); break;
case 13: setcolor(15); box(530,185,550,205,1,13); break;
case 14: setcolor(15); box(555,185,575,205,1,14); break;
case 15: setcolor(14); box(580,185,600,205,1,15); break;
case 16: setcolor(15); box(605,185,625,205,1,16); break;
} // fin azul9
tecla=getch();
switch(i){
case 1: setcolor(1); box(430,160,450,180,1,1); break;
case 2: setcolor(2); box(455,160,475,180,1,2); break;
case 3: setcolor(3); box(480,160,500,180,1,3); break;
case 4: setcolor(4); box(505,160,525,180,1,4); break;
case 5: setcolor(5); box(530,160,550,180,1,5); break;
case 6: setcolor(6); box(555,160,575,180,1,6); break;
case 7: setcolor(7); box(580,160,600,180,1,7); break;
case 9: setcolor(9); box(430,185,450,205,1,9); break;
case 10: setcolor(10); box(455,185,475,205,1,10); break;
case 11: setcolor(11); box(480,185,500,205,1,11); break;
case 12: setcolor(12); box(505,185,525,205,1,12); break;
case 13: setcolor(13); box(530,185,550,205,1,13); break;
case 14: setcolor(14); box(555,185,575,205,1,14); break;
case 15: setcolor(16); box(580,185,600,205,1,15); break;
case 16: setcolor(16); box(605,185,625,205,1,16); break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x4d' : i++;break;
case 'x4b' : i--; break;
}
if (i>16) i=1;
if (i<1) i=16;
break; //fin cero
case 'xD':
if (FRASE==0)
{ setcolor(2);box(135,215,315,255,1,11);
setcolor(10); box(136,216,314,224,1,13);
setcolor(2); settextstyle(12,0,5);
outtextxy(140,234,"INTRODUCIR UNA FRASE");
delay(1140); setcolor(2); box(135,215,315,255,1,7);
settextstyle(11,0,2);
}
else{
switch(i)
{ case 1: ct=1; cartel(); break;
case 2: ct=2; cartel(); break;
case 3: ct=3; cartel(); break;
case 4: ct=4; cartel(); break;
case 5: ct=5; cartel(); break;
case 6: ct=6; cartel(); break;
case 7: ct=7; cartel(); break;
case 8: ct=8; cartel(); break;
case 9: ct=9; cartel(); break;
case 10: ct=10; cartel(); break;
case 11: ct=11; cartel(); break;
case 12: ct=12; cartel(); break;
case 13: ct=13; cartel(); break;
case 14: ct=14; cartel(); break;
case 15: ct=15; cartel(); break;
case 16: ct=16; cartel(); break;
} break; //fin enter
}//fin tecla
} } while(tecla!= 'x1B'); settextstyle(11,0,2); setcolor(15);
}
void menu() //MENU PRINCIPAL.
{
int i,j, cf=8, ct=15;
j=320;
box(0,0, getmaxx(), getmaxy(),1,7);
settextstyle(11,0,2);
setbkcolor(7);
setcolor(8);
box(0,0,getmaxx(),20,1,11); setcolor(4);outtextxy(10,5,"CARTEL");
setcolor(13);outtextxy(540,5,"");
setcolor(8);box(0,18,getmaxx(),40,1,8);
setcolor(BLACK);
box(10,20,110,40,1,8);
setcolor(15);outtextxy(35, 30, "ARCHIVO");
setcolor(8);box(120,20,230,40,1,8);
setcolor(15);outtextxy(130,30, "HERRAMIENTAS");
setcolor(8);box(240,20,350,40,1,8);
setcolor(15);outtextxy(275, 30, "SALIR");
settextstyle(2,0,0);setcolor(8); outtextxy(440,230,"COLOR DE TEXTO");
settextstyle(2,0,0);setcolor(8); outtextxy(440,250,"COLOR DE FONDO");
setcolor(ct); box(535,230,545,240,1,15);
setcolor(cf); box(535,250,545,260,1,16);
settextstyle(11,0,2);
fondo();
texto();
}
void desplazamiento() //submenu desplazamiento.
{
setcolor(15);
box(256,46,400,140,1,8);
box(256,49,400,69,1,1);
setcolor(15);outtextxy(257,59, "Derecha-izquierda");
box(256,72,400,92,1,1);
setcolor(15);outtextxy(257,82, "Izquierda-Derecha");
box(256,95,400,115,1,1);
setcolor(15);outtextxy(257,105, "Hacia Arriba");
box(256,118,400,138,1,1);
setcolor(15);outtextxy(257,128, "Hacia Abajo");
}
void moverdespla() //mover desplazamiento.
{
char tecla;
int i=1, MOVIMIENTO;
desplazamiento();
do{
switch(i)
{
case 1: box(256,49,400,69,1,9);
setcolor(11);outtextxy(257,59, "Derecha-izquierda");
break;
case 2: box(256,72,400,92,1,9);
setcolor(11);outtextxy(257,82, "Izquierda-Derecha");
break;
case 3: box(256,95,400,115,1,9);
setcolor(11);outtextxy(257,105, "Hacia Arriba");
break;
case 4: box(256,118,400,138,1,9);
setcolor(11);outtextxy(257,128, "Hacia Abajo");
break;
} // fin azul9
tecla=getch();
switch(i){
case 1: setcolor(15); box(256,49,400,69,1,1);
outtextxy(257,59, "Derecha-izquierda");
break;
case 2: setcolor(15);box(256,72,400,92,1,1);
outtextxy(257,82, "Izquierda-Derecha");
break;
case 3: setcolor(15);box(256,95,400,115,1,1);
outtextxy(257,105, "Hacia Arriba");
break;
case 4: setcolor(15);box(256,118,400,138,1,1);
outtextxy(257,128, "Hacia Abajo");
break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x50' : i++;break;
case 'x48' : i--; break;
}
if (i>4) i=1;
if (i<1) i=4;
break; //fin cero
case 'xD':
switch(i)
{ case 1: MOVIMIENTO=1;mover(); tecla='x1b'; break;
case 2: MOVIMIENTO=2;mover(); tecla='x1b'; break;
case 3: MOVIMIENTO=3;mover(); tecla='x1b'; break;
case 4: MOVIMIENTO=4;mover(); tecla='x1b'; break;
}
break; //fin enter
}//fin tecla
} while(tecla!= 'x1B');
if (tecla='x1B') setcolor(7); box(100,43,400,190,1,7);
}
void submenu2()
{ setcolor(15);
box(120,43,255,73,1,8);
box(120,43,255,63,1,1);
setcolor(15);outtextxy(122,50, "Desplazamiento");
box(120,66,255,89,1,1);
setcolor(15);outtextxy(122,70, "Ayuda");
}
void moversubmenu2()
{
char tecla;
int i=1;
submenu2();
do{
switch(i)
{
case 1: setcolor(15);box(120,43,255,63,1,9);
outtextxy(122,50, "Desplazamiento");
break;
case 2: setcolor(15);box(120,66,255,89,1,9);
outtextxy(122,70, "Ayuda");
break;
} // fin azul9
tecla=getch();
switch(i){
case 1: setcolor(15);box(120,43,255,63,1,1);
outtextxy(122,50, "Desplazamiento");
break;
case 2: setcolor(15);box(120,66,255,89,1,1);
outtextxy(122,70, "Ayuda");
break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x50' : i++;break;
case 'x48' : i--; break;
}
if (i>2) i=1;
if (i<1) i=2;
break; //fin cero
case 'xD':
switch(i)
{ case 1: moverdespla(); tecla='x1b'; break;
case 2: tecla='x1b';
setcolor(15);
box(150,150,375,250,1,9);
setcolor(1);box(151,151,374,163,1,1);
settextstyle(2,0,4);setcolor(11);outtextxy(305,151,"Ayuda");
settextstyle(11,0,2);setcolor(1);outtextxy(153,175," ");
settextstyle(7,0,3);setcolor(11);outtextxy(154,185, " EL CARTEL ");
settextstyle(2,0,4);setcolor(15);outtextxy(160,235, " MONGE'S ");
settextstyle(11,0,2);
delay(2000);
setcolor(7); box(150,150,375,250,1,7);
break;
}
break; //fin enter
}//fin tecla
} while(tecla!= 'x1B');
if (tecla='x1B') setcolor(7); box(120,42,280,180,1,7);
}
void archivo() //GUARDAR EL ARCHIVO
{ FILE *arch;
char cad[8];
char texto1[70];
int pos,f,i,j,t,tecla,MOVIMIENTO,G=0;
cad[0]='x0';
setcolor(15);
box(150,150,350,250,1,9);
setcolor(1); box(155,200,345,220,1,1);
setcolor(1);box(151,151,349,163,1,1);
settextstyle(11,0,2);setcolor(9);outtextxy(165,180,"NOMBRE DEL ARCHIVO:");
settextstyle(2,0,4);setcolor(9);outtextxy(305,151,"Guardar");
do{
setcolor(15);
outtextxy(160,205,cad);
tecla=getch();
if(isalpha(tecla))
{
pos=strlen(cad);
cad[pos]= tecla;
cad[pos+1]='x0';
}
if (tecla=='x8')
{
setcolor(1);
outtextxy(160,205,cad);
pos=strlen(cad);
cad[pos-1]='x0';
}
}while (tecla!='xD');
for(i=0;i<8;i++)
R.nombre<em>=cad<em>;
i=strlen(cad);
R.nombre<em>='x0';
arch=fopen(cad,"w");
{
for(i=0;i<65;i++)
{ R.frase<em>=texto1<em>;
}
R.colorfondo=getpixel(540,255);
R.colortexto=getpixel(540,235);
R.efecto=MOVIMIENTO;
if(arch!=NULL)
{
fwrite(&R,sizeof(R),1,arch);
fclose(arch);
} }
settextstyle(11,0,2);
if (tecla=='xd')
G=1;
setcolor(7); box(150,150,350,250,1,7);
}
void abrir() //BUSCAR EL ARCHIVO
{ FILE *arch;
char cad[8];
char texto1[70];
int pos,f,x,y,t,i,j,cf=8,ct=15, tecla, MOVIMIENTO, FRASE=0;
cad[0]='x0';
f=5;
t=15;
x=160;
y=205;
setcolor(15);
box(150,150,350,250,1,9
);
setcolor(1);box(155,200,345,220,1,1);
setcolor(1);box(151,151,349,163,1,1);
settextstyle(11,0,2);setcolor(15);outtextxy(165,180," NOMBRE DEL ARCHIVO:");
settextstyle(2,0,4);setcolor(15);outtextxy(305,151,"Buscar");
do{
setcolor(15);
outtextxy(160,205,cad);
tecla=getch();
if(isalpha(tecla))
{
pos=strlen(cad);
cad[pos]= tecla;
cad[pos+1]='x0';
}
if (tecla=='x8')
{
setcolor(1);
outtextxy(160,205,cad);
pos=strlen(cad);
cad[pos-1]='x0';
}
}while (tecla!='xD');
arch=fopen(cad,"rb+");
if(arch==NULL)
{ setcolor(7); box(150,150,350,260,1,7);
setcolor(11);box(135,215,330,260,1,11);
setcolor(7); box(136,216,329,230,1,9);
setcolor(9); settextstyle(2,0,4); outtextxy(140,234," NO SE ENCONTRO EL ARCHIVO!");
delay(1140); setcolor(7); box(130,215,330,260,1,7);
settextstyle(11,0,2);
}
else
{
fread(&R,sizeof(R),1,arch);
for(i=0;i<8;i++)
cad<em>=R.nombre<em>;
i=strlen(cad);
cad<em>='x0';
if (tecla='xd')
setcolor(7); box(150,150,350,260,1,7);
for(i=0;i<65;i++)
texto1<em>=R.frase<em>;
cf=R.colorfondo;
ct=R.colortexto;
MOVIMIENTO=R.efecto;
fclose(arch);
setcolor(7); box(150,150,350,260,1,7);
FRASE=1;
cartel();
FRASE=1;
mover();
}
settextstyle(11,0,2);
setcolor(15);
}
void submenu1()//MOVER ARCHIVO
{
settextstyle(11,0,1);
setcolor(15);
box(10,43,165,135,1,8);
box(10,43,165,63,1,1);
outtextxy(15,50,"Nueva frase");
box(10,66,165,86,1,1);
outtextxy(15,72,"Guardar");
box(10,89,165,109,1,1);
outtextxy(15,97,"Abrir");
box(10,112,165,132,1,1);
outtextxy(15,120,"Salir");
}
void moversubmenu1()
{
char tecla;
int i=1;
submenu1();
do{
switch(i)
{
case 1: setcolor(1);box(10,43,165,63,1,9);
outtextxy(15,50,"Nueva frase");
break;
case 2: setcolor(1);box(10,66,165,86,1,9);
outtextxy(15,72,"Guardar");
break;
case 3: setcolor(1);box(10,89,165,109,1,9);
outtextxy(15,97,"Abrir");
break;
case 4: setcolor(1); box(10,112,165,132,1,9);
outtextxy(15,120,"Salir");break;
} // fin azul9
tecla=getch();
switch(i){
case 1: setcolor(15);box(10,43,165,63,1,1);
outtextxy(15,50,"Nueva frase");
break;
case 2: setcolor(15);box(10,66,165,86,1,1);
outtextxy(15,72,"Guardar");
break;
case 3: setcolor(15);box(10,89,165,109,1,1);
outtextxy(15,97,"Abrir");
break;
case 4: setcolor(15); box(10,112,165,132,1,1);
outtextxy(15,120,"Salir");
break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x50' : i++;break;
case 'x48' : i--; break;
}
if (i>4) i=1;
if (i<1) i=4;
break; //fin cero
case 'xD':
switch(i)
{ case 1: setcolor(7); box(10,43,165,162,1,7); frase(); tecla='x1B';
break;
case 2: setcolor(7); box(10,43,165,162,1,7);archivo(); tecla='x1B';
break;
case 3: setcolor(7); box(10,43,165,162,1,7);setcolor(7);
box(0,280,getmaxx(),getmaxy(),1,7); abrir(); tecla='x1B'; break;
case 4: tecla='x1B'; break;
}
break; //fin enter
}//fin tecla
} while(tecla!= 'x1b');
if (tecla='x1B') setcolor(7); box(10,43,165,160,1,7);
setcolor(7);
setfillstyle(1,7);
bar3d(190,200,350,260,5,1);
}
void salir()
{ char tecla;
setcolor(15);
box(150,150,350,250,1,9);
setcolor(1);box(151,151,349,163,1,5);
settextstyle(2,0,4);setcolor(15);outtextxy(305,151,"SALIR");
settextstyle(11,0,5);setcolor(15);outtextxy(152,170," ¨¨DESEA GUARDAR EL");
settextstyle(11,0,5);setcolor(15);outtextxy(152,184," CARTEL ANTES DE SALIR??");
setcolor(1);box(160,151,349,163,1,1);
settextstyle(11,0,2);setcolor(15);outtextxy(185,210,"Si No");
}
void SINO()
{ char tecla;
int i=1, G=0;
salir();
do{
switch(i)
{
case 1: settextstyle(11,0,3);setcolor(9);outtextxy(185,210,"Si");
settextstyle(11,0,3);setcolor(11);outtextxy(185,210,"SI");
break;
case 2: settextstyle(11,0,3);setcolor(9);outtextxy(185,210," No ");
settextstyle(11,0,3);setcolor(11);outtextxy(185,210," NO ");
break;
} // fin azul9
tecla=getch();
switch(i){
case 1: settextstyle(11,0,3);setcolor(9);outtextxy(185,210,"SI");
settextstyle(11,0,3);setcolor(15);outtextxy(185,210,"Si");
break;
case 2: settextstyle(11,0,3);setcolor(9);outtextxy(185,210," NO ");
settextstyle(11,0,3);setcolor(15);outtextxy(185,210," No ");
break;
}//fin 9
switch(tecla)
{
case 'x0': tecla=getch();
switch (tecla)
{
case 'x4d' : i++;break;
case 'x4b' : i--; break;
}
if (i>2) i=1;
if (i<1) i=2;
break; //fin cero
case 'xD':
switch(i)
{ case 1: archivo(); tecla='x1B'; break;
case 2: G=1;tecla='x1B'; break;
}
break; //fin enter
}//fin tecla
} while(tecla!= 'x1b');
if (tecla=='x1B')
tecla='x1B';
setcolor(7); box(150,150,350,250,1,7);
}
void mueve() //para menu principal.
{
char tecla;
int i=1,n,G=0;
setcolor(7);
settextstyle(11,0,2);
menu();
do{
switch(i)
{
settextstyle (1,0,1);
case 1: setcolor(1);box(10,20,110,40,1,1);
setcolor(15);
outtextxy(35, 30, "ARCHIVO");
break;
case 2: setcolor(1);box(120,20,230,40,1,1);
setcolor(15);outtextxy(130,30, "HERRAMIENTAS");
break;
case 3: setcolor(1);box(240,20,350,40,1,1);
setcolor(15);outtextxy(275, 30, "SALIR");
break;
case 4: box(423,55,603,68,1,1);
setcolor(11); outtextxy(425,58,"SELECCIONA PARA FONDO");
break;
case 5: box(423,140,603,152,1,1);
setcolor(11); outtextxy(430,143,"SELECCIONA PARA TEXTO");
break;
}//fin light
tecla=getch();
switch(i)
{
case 1: setcolor(8);box(10,20,110,40,1,8);
setcolor(15);outtextxy(35, 30, "ARCHIVO");
break;
case 2: setcolor(8);box(120,20,230,40,1,8);
setcolor(15