Animation
Posted by Andi
on
Tuesday, 28 September 2010
, under
C++
|
komentar (0)
This program almost same with others animation program. The $ character will be printed on the top of the screen.
This program created using C++ editor. Here is the code:
#include
#include
#include
void main()
{
int x,y,ay;
clrscr();
x=random(78)+1;
y=random(4)+1;
ay=random(5)+1;
_setcursortype(_NOCURSOR);
textcolor(random(16));
do{
gotoxy(x,y); cprintf("$");
delay(100);
gotoxy(x,y); cout<<" "; y=y+ay; x=random(78)+1; if (y>=20)
{
gotoxy(x,y); cprintf("$");
x=random(78)+1;
y=random(4)+1;
ay=random(5)+1;
textcolor(random(16));
}
}while(!kbhit());
getch();
}