===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<stdlib.h>
#include<dos.h>
char str[30];
void go(char str[30])
{
int x,y,len,t;
for(int i=0;str[i]!='\0';i++);
len=i-1;
randomize();
for(y=1,x=1;;y+=2)
for(int j=0;j<=1;x+=2,j++)
{
t=random(15)+1;
textcolor(t);
if(x>79-len)
x=1;
if(y>25)
y=1;
gotoxy(x,y);
for(i=0;str[i]!='\0';i++)
cprintf("%c",str[i]);
delay(100);
gotoxy(x,y);
for(i=0;str[i]!='\0';i++)
cout<<" ";
if(kbhit())
exit(0);
}
}
void main()
{
clrscr();
gets(str);
go(str);
}
CODING
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<stdlib.h>
#include<dos.h>
char str[30];
void go(char str[30])
{
int x,y,len,t;
for(int i=0;str[i]!='\0';i++);
len=i-1;
randomize();
for(y=1,x=1;;y+=2)
for(int j=0;j<=1;x+=2,j++)
{
t=random(15)+1;
textcolor(t);
if(x>79-len)
x=1;
if(y>25)
y=1;
gotoxy(x,y);
for(i=0;str[i]!='\0';i++)
cprintf("%c",str[i]);
delay(100);
gotoxy(x,y);
for(i=0;str[i]!='\0';i++)
cout<<" ";
if(kbhit())
exit(0);
}
}
void main()
{
clrscr();
gets(str);
go(str);
}
===========================================================================
No comments:
Post a Comment