[ C-Programming Project ] - Depiction of free fall of leters as in movie-matrix .

C » Games and Graphics:
This is a code to depict matrix movie free fall of letters style written in c++.save it with .cpp extension.

#include"stdio.h"
#include"conio.h"
#include"dos.h"
#include"stdlib.h"
void main()
{
 char c,d;
 int i,j;
char a[15]={' ','A','D',' ','I','T','Y',' ','A',' ','A','D',' ','I',''};
//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);
   }
   }
  }

No comments:

Post a Comment