#include <graphics.h>
#include <conio.h>
#include <dos.h>
void Figure ( int x, int y, int color )
{
setcolor ( color );
line ( x, y, x+20, y );
line ( x, y, x+10, y-20 );
line ( x+10, y-20, x+20, y );
}
void main()
{
int d = VGA, m = VGAHI;
int x, y, dx;
initgraph ( &d, &m, "c:\\borlandc\\bgi" );
x = 0; y = 240;
dx = 1;
while ( x + 20 < 640 )
{
if ( kbhit() )
if ( getch() == 27 ) break;
Figure ( x, y, YELLOW );
delay ( 20 );
Figure ( x, y, BLACK );
x += dx;
}
closegraph();
}