#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 Interrupt(_CPPARGS)
{
 static int x =2;
 static int y =2;
 gotoxy(x,y);
 cout << "|";

 static int xx =2;
 static int yy =2;
 gotoxy(xx,yy);
 cout << "/";

 static int xxx=3;
 static int yyy=3;
 gotoxy(xxx,yyy);
 cout << "-";

 x++;
 yy++;
 xxx++;
 yyy++;


 if(x>30)
 {
 x=1;clrscr();
 }
 if(yy>30)
 {
 yy=1;clrscr();
 }

 if(xxx>30)
 {
 if(yyy>30)
 {
 xxx=1;clrscr();
 yyy=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,Interrupt);

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

 setvect(IMTP,OldInterrupt);
}
