Saturday, July 10, 2010

Hour Glass


Hourglass animation in C++.
Truly amazing!
Created by Amit Garg (who is not interested in publicizing himself) and myself in 2008.


PS: Since the blog editor doesn't accept the special characters '<' & '>' (or I haven't figured out how to make them accepted) which are very frequently used in C++, I have replaced them (using Microsoft Word).

'<' has been replaced by '~' and '>' has been replaced by '?'. So to run the program first replace the characters back to original.



#include~iostream.h?
#include~conio.h?
void main()
{
clrscr();
float i,j,k,l;
int a,b,c,d,e,f,g=0,a1,b1,c1,d1,e1,f1=12,g1=0;
gotoxy(30,13);
cout~~"An Ankit-Amit Creation";
gotoxy(1,1);
for(long t=0;t~=999999999;t++);
cout~~" ";
for(i=1 ;i~=25;++i)
cout~~"*";
cout~~endl;
for(i=10;i?=0;--i)
{
for(j=12;j?=i;j--)
cout~~" ";
for(k=i;k?=0;k=k -0.5)
cout~~".";
cout~~endl;
}
for(i=10;i?=0;--i)
{
for(j=0;j ~=i+2;j++)
cout~~" ";
for(k=10;k?=i;k=k-0.5)
cout~~" ";
cout~~endl;
}
cout~~" ";
for(i=1;i~=25;++i)
cout~~"*";
j=2;k=3;
for(i=1;i~=11;i++)
{
gotoxy(k++,j++ );
cout~~"*";
}
gotoxy(13,13);
cout~~"*";
j=13;k=13;
for(i=0;i~= 10;i++)
{
gotoxy(k--,j++ );
cout~~"*";
}
j=25;k=2;
for(i=1;i~=11;i++)
{
gotoxy(j--,k++);
cout~~"*";
}
j=15;k=13;
for(i=1;i~=11;i++)
{
gotoxy(j++,k++ );
cout~~"*";
}
for(long ll=1;ll~199999999;++ll);
for(i=1;i~12;++i)
{
e1=14;
for(int kk=1;kk~=12&&i==1;++kk)
{
gotoxy(e1,f1++);
cout~~".";
for(long jj=1;jj~=29999999;++jj);
}
}
for(i=1;i~12;++i)
{
for(long ll=1;ll~29999999;++ll);
g++; g1++;
a=14-i; a1=14-i;
c=14+i; c1=14+i;
b=2; b1=23;
d=2; d1=23;
e=14;
f=2;
for(j=i;j?=1;j--)
{
gotoxy(e,f++);
cout~~" ";
if(g!=11)
{
gotoxy(a++,b++);
cout~~" ";
gotoxy( c--,d++);
cout~~" ";
gotoxy(a1 ++,b1--);
cout~~".";
gotoxy( c1--,d1--);
cout~~".";
}
for(long ll=1;ll~29999999;++ll);
}

}
getch();
}

No comments:

Post a Comment