#include <iostream.h>
#include <iomanip.h>
#include <dos.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>

#define IMTP 0x1c
#define _CPPARGS ...

void interrupt MyInterrupt(_CPPARGS)
{
 static int x = 1;
 static int y = 1;

 gotoxy(x,y);
 cout << "*";
 //x++;
 //y++;
 //if(x==20&&y==20){x=1;y=1; clrscr();}
 x++;
 if(x>30){x=1;clrscr();}

 if(y==1) {y = 3;return;}
 if(y==3) {y = 1;return;}

}

void main()
{
 clrscr();

 void interrupt (*OldInterrupt)(_CPPARGS) = getvect(IMTP);
 setvect(IMTP,MyInterrupt);

 int end = 0;
 while(!end) if(kbhit()) end = (getch()==27);

 setvect(IMTP,OldInterrupt);
}
