Simple HC text animation 06-29-2014, 07:28 AM
#1
I was getting bored, so coded this extremely simple Animation in C.
The output:
![[Image: ani.gif]](http://bappamehendi.com/images/ani.gif)
Compiler used: Turbo C++ [Yes, I still use this good old compiler apart from GCC]
The Source Code:
The output:
![[Image: ani.gif]](http://bappamehendi.com/images/ani.gif)
Compiler used: Turbo C++ [Yes, I still use this good old compiler apart from GCC]
The Source Code:
Code:
#include<graphics.h>
#include<dos.h>
#include<conio.h>
#include<stdio.h>
int main()
{
int i, gd = DETECT, gm;
initgraph(&gd,&gm,"c:\\turboc3\\bgi"); //path to your bgi folder in double quotes
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(25,240,"Press any key to start rolling HC");
getch();
setviewport(0,0,639,440,1);
for( i = 0 ; i <= 420 ; i = i + 10 )
{
rectangle(40+i,250,70+i,400); //the 1st vertical line in H (|)
rectangle(140+i,330,70+i,300); //the horizontal line in middle of H (-)
rectangle(140+i,250,170+i,400); the last vertical line in H (|)
ellipse(280+i,320,60,300,90,80); //for the outer part of C
ellipse(280+i,320,60,300,70,60); //inner part of C
setcolor(RED);
delay(100);
if( i == 420 )
break;
clearviewport();
}
getch();
closegraph();
return 0;
}![[Image: MUJ8qSW.png]](http://i.imgur.com/MUJ8qSW.png)
-----------------------------------
Now learning:
Android Development, Java
Working on:
An FTP Client for Android
-----------------------------------
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
The reputation says all. So, how do I overcome this? Any suggestions? and how do I complete the C? you can see that C is not bounded like H. I tried using another 2 lines but that would make it messy. Any simpleway out?