c stuff

we are all fond of c as a programmer .....
we loved it......
i hope all you people watched the movie "matrix"...
here is a c program which displays like a matrix type fall of letters.....
try it...modify it....enjoy it......

falling letters like in the movie matrix

#include
#include
#include
#include

void main()
{
char c,d;
int i,j;
char a[15]={' ','A','D',' ','I','T','Y',' ','A',' ','A','D',' ','I','
'};//here characters are taken as my name
//u can change it to any other characters as yr own name
char far* p;
p=(char far*)0xb0008000;// vga memory address

clrscr();

randomize();
while(!kbhit())
{
delay(0);
for(i=0;i<160;i=i+6)
{
for(int j=0;j<50;j++)
{ *(p+160*j+i+1)=2;
*(p+160*j+i)=a[random(15)];

delay(0);
}
delay(0);
}
delay(200);

for(int k=0;k<10;k++)
{
for(i=0;i<160;i+=6)
{
for(j=0;j<25;j++)
{ c=*(p+160*j+i);
d=*(p+160*(j+1)+i);
*(p+160*(j+1)+i)=c;
c=d;
}
delay(0);
*(p+i)=c;
}
delay(0);
}

}
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More