C++ Fish Animated

Ayo Membuat aquarium dengan C++...

Sekedar buat belajar aja, mari belajar bersama dengan bahasa program C++..



Berikut adalah Source Codenya Tinggal Copy Paste aja..hehe

___________________________________________________________________________________________________//___

#include iostream // tamabahkan tanda < > di iostream

#include windows.h //tambahkan tanda < > di windows.h

#include conio.h // tambahkan tanda < > di conio.h

using namespace std;

void gotoxy(int x, int y){

COORD coord;

coord.X = x;

coord.Y = y;

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);

}

void loading() {

system("cls");

cout << "Loading.";

Sleep(1000); // delay 1 second

system("cls");

cout << "Loading..";

Sleep(1000);

system("cls");

cout << "Loading...";

Sleep(1000);

system("cls");

cout << "Loading....";

Sleep(1000);

system("cls");

cout << "Loading.....";

Sleep(1000);

system("cls");

Sleep(1000);;

cout << "Loading......";

system("cls");

}

int main() {

system("cls"); //clear the screen

loading();

system("cls");

gotoxy(16,1); cout << "FISH ANIMATION 1.0";

gotoxy(5,2); cout << " hend, sourcefrom: jakerpomperada@yahoo.com";

// loop thru left to right direction

for(int a =1; a<50; a="a+2){

gotoxy(a,3);

cout << "~^";

}

//loop thru top to bottom direction

for(int a =1; a<20;>

gotoxy(49,a);

cout << "||";

}

//loop thru right to left direction

for(int a =48; a>0; a--){

gotoxy(a,19);

cout << "=";

}

//loop thru bottom to top direction

for(int a = 19; a>0; a--){

gotoxy(0,a);

cout << "||";

}

int time=0;

while(time <= 10){

//go

for(int a =3; a<40;>

//fish 1

Sleep(100);

gotoxy(a,6);

cout << " __";

gotoxy(a,7);

cout << " \\/ o\\";

gotoxy(a,8);

cout << " /\\__/";

gotoxy(a,9);

cout << " ";

gotoxy(45-a-2,13);

cout << " , ";

gotoxy(45-a-2,14);

cout << " <' (=< ";

gotoxy(45-a-2,15);

cout << " ' ";

gotoxy(45-a-2,16);

cout << " ";

}

for(int a =40; a>3; a--){

Sleep(100);

gotoxy(a,6);

cout << " __ ";

gotoxy(a,7);

cout << " /o \\/ ";

gotoxy(a,8);

cout << " \\__/\\ ";

gotoxy(a,9);

cout << " ";

gotoxy(3+40-a,13);

cout << " ' ";

gotoxy(3+40-a,14);

cout << " >=) '> ";

gotoxy(3+40-a,15);

cout << " ' ";

gotoxy(3+40-a,16);

cout << " ";

}

time++;

}

getch();

system("cls");

return 0;

}

_______________________________________________________________________________________________________

sourcefrom: jakerpomperada@yahoo.com


0 komentar to "C++ Fish Animated"

Posting Komentar