Created sahrul-media
ChatBox
Headlines News :
Home » » Program Membuat Game Tebak Angka

Program Membuat Game Tebak Angka

Written By Gunawan on Rabu, 14 Mei 2014 | 00.26


LAPORAN TUGAS UAS
PEMROGRAMAN DEV C++
TENTANG
(PROGRAM GAME TEBAK ANGKA)

Diajukan untuk memenuhi tugas (UAS) matakuliah Pemprograman Dev C++












 Disusun Oleh :
Sahrul Gunawan




FAKULTAS TEKNOLOGI INFORMASI
PROGRAM STUDI TEKNIK INFORMATIKA
UNIVERSITAS KANJURUHAN MALANG
2014



Tentang program yang dibuat:
Program Game Tebak Angka yang dibuat ini dijalankan dengan software Dev C++ dengan menggunakan bahasa pemrograman C++. Fungsi-fungsi yang ditanamkan/digunakan dalam program yang dibuat meliputi fungsi Class, For, If-else, Switch-Case, Do-While. Program Game Tebak Angka ini dibagi menjadi 3 Level/Tingkatan, yaitu Level Easy(Mudah), Medium(Sedang), dan Hard(Susah). Untuk pembagian jenisnya antara lain sebagai berikut :
1.      Level Easy antara 0-50
2.      Level Medium antara 0-200
3.      Level Hard antara 0-1000
Cara kerja program :
Cara kerja program game ini cukup sederhana, yaitu user hanya diminta untuk memasukkan angka sesuai dengan yang di-inginkan program. Program akan memilih sebuah angka secara random/acak. Jika angka yang di-inputkan user tidak sesuai maka program akan memberikan informasi “Terlalu Rendah” atau Terlalu Tinggi” sampai user dapat menebak angka yang di-ingikan program. Setelah user dapat menebak angka yang di-inginkan program maka program akan memberi nilai user sesuai dengan jumlah tebakan user. Jika user dapat menebak angka yang di-inginkan program sebanyak kurang dari 6x tebakan (maksimal 5x tebakan) maka program akan menilai user “Very Good…”,sedangkan jika tebakan user lebih dari 5x maka program akan menilai user “Not Bad, Tingkatkan lagi...”.

Langkah-langkah menjalankan program :
1.      User diminta untuk memasukkan nama sebelum memulai game.
2.      User akan diminta memasukkan password yang berupa 6 digit angka.
3.      User akan diminta memilih menu yang tersedia dalam program, yaitu Pilih Level, Petunjuk, Keluar.
4.      Jika user memilih menu Pilih Level, maka program akan menampilkan level yang tersedia.
5.      Jika user memilih menu Petunjuk, maka program akan menampilkan petunjuk/cara menggunakan program.
6.      Jika user memilih menu Keluar,maka program berakhir/selesai.


Screenshoot Program :
1.      Tampilan awal program

2.      Tampilan Loading



3.      Tampilan Login Pasword

4. Tampilan Menu Utama






5. Tampilan Pilih Level















6.     Tampilan Petunjuk


7.      Tampilan Keluar

















Sintaks Program :
#include <cstdlib>
#include <iostream>
using namespace std;
class program{
      public :
             void tampilan_awal();
             void login();
             void loading();
             void loading01();
             void tebak_angka();
             void level_01();
             void level_02();
             void level_03();
             void petunjuk();
             void keluar();
      private :
              char nama_user[200];
              int pilih;
              };

void program::tampilan_awal(){
cout<<"\n\n";
cout<<"           [ Untuk menjalankan program ini silakan masukkan nama anda ]\n\n";
cout<<"                        ==> Nama : ";cin.getline(nama_user, sizeof(nama_user));
cout<<endl;  
system("CLS");
loading();
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n\n\n";
cout<<"                   :: Data telah tersimpan di database :: \n\n\n\n\n\n\n\n\n\n\n\n"<<endl;

system("pause");
system("CLS");
cout<<"\n\n\n\n\n\n"<<endl;
cout<<"                               [ Hello, "<<nama_user<<" ]"<<endl;
cout<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       SELAMAT DATANG DALAM PROGRAM TEBAK ANGKA       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<endl;
cout<<"                     ( Untuk melanjutkan silakan tekan ENTER )         \n";
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
login();
}

void program::login(){
system("CLS");
int password;
int kunci;
kunci=123321;
cout<<"\n\n\n\n\n\n\n\n\n\n\n";
cout<<"                    :: Password dalam bentuk digit angka ::\n";
cout<<"                          ( Mengandung 6 digit angka )     \n\n";
cout<<"                     ==> Masukkan Password : ";
cin>>password;
if (password == kunci){
system("CLS");
loading01();
system("CLS");
loading01();
system("CLS");
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n\n\n";
cout<<"                          [ Login SUCCESS ]"<<endl<<endl;
cout<<"\n\n\n\n\n\n\n\n\n\n\n";
system("pause");
system("CLS");
tebak_angka();
}
else{
system("CLS");
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n\n";
cout<<"                              [ Paswword INVALID ]"<<endl<<endl;
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n";
system("pause");
login();
}
}

void program::loading(){
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n                                   loading"<<endl;
cout<<"                _________________________________________________"<<endl;
cout<<"                ";
for(long int i=1;i<50;i++){
    for(long int x=0;x<5000;x++){
        for(long int y=0;y<5000;y++){}
}
cout<<"|";
}
cout<<endl;
}

void program::loading01(){
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n                                   "<<endl;
cout<<"                   Silakan tunggu";
cout<<" ";
for(long int i=1;i<=10;i++){
    for(long int x=0;x<5000;x++){
        for(long int y=0;y<5000;y++){}
}
cout<<".";
}
}

void program::keluar(){
system("CLS");
loading();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       Terima kasih telah menggunakan program ini     "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "               Semoga dapat bermanfaat "<<char(1)<<"              "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
}
void program::petunjuk(){
system("CLS");
loading01();
system("CLS");
loading01();
system("CLS");
cout<<"\n\n"<<endl;
cout<<"                               - PETUNJUK PERMAINAN - \n\n";
cout<<"             "<<char(201);
for(int i=1; i<=55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " Petunjuk permainan ini cukup sederhana, anda tinggal  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " memilih level yang telah tersedia, yaitu LEVEL EASY-  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " LEVEL MEDIUM-LEVEL HARD. Untuk LEVEL EASY antara 0-50 "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " ,MEDIUM 0-200,dan HARD 0-1000. Kemudian anda tinggal  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " memasukkan angka yang anda inginkan sampai angka ter- "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " sebut seuai dengan angka yang diminta komputer secara "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " acak. Mudah bukan cara mainnya, sekarang silakan men- "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< " coba. Let's Play...                                   "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "             [ Tekan ENTER untuk kembali ]             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<=55; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
system("pause");
system("CLS");
loading01();
tebak_angka();
}

void program::tebak_angka(){
menu_utama:
system("CLS");
cout<<endl<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "              - DASAR-DASAR PEMROGRAMAN -             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       Created by :                                   "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       1. Indra Dwi Ananto       [ 09018107 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       2. Ilham Nurfuadi         [ 09018115 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       3. Satuhu Suseta Prasetya [ 09018143 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<endl<<endl;
cout<<"                          "<<char(5)<<" Game Tebak Angka "<<char(5)<<endl<<endl<<endl;
cout<<"                  Menu Permainan: \n\n";
cout<<"                       1. Pilih Level\n";
cout<<"                       2. Petunjuk   \n";
cout<<"                       3. Keluar     \n\n";
cout<<"                  Masukkan pilihan : ";
cin >> pilih;
if (pilih == 1) {
system("CLS");
ulang:
cout<<endl<<endl;
cout<<"                        "<<char(5)<<" Game Tebak Angka "<<char(5)<<endl<<endl<<endl;
cout<<"                Level yang tersedia : \n\n";
cout<<"                  1. Easy   < 0-50   >\n";
cout<<"                  2. Medium < 0-200  >\n";
cout<<"                  3. Hard   < 0-1000 >\n\n";
cout<<"               Anda memilih level : ";
cin >> pilih;
if (pilih == 1)     {
system("CLS");
loading01();
level_01();
}
else if (pilih == 2){
system("CLS");
loading01();
level_02();
}
else if (pilih == 3){
system("CLS");
loading01();
system("CLS");
level_03();
}
else{
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "            LEVEL TIDAK TERSEDIA ! ! !                "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "          [ Tekan ENTER untuk kembali ]               "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
system("CLS");    
goto ulang;
}
}
else if (pilih == 2) {
petunjuk();
}
else if (pilih == 3) {
keluar();
}
else {  
system("CLS");
loading01();
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "               PILIHAN ILEGAL  ! ! !                  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "          [ Tekan ENTER untuk kembali ]               "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
system("CLS");    
tebak_angka() ;
}
}

void program::level_01(){
system("CLS");
cout<<endl<<endl;
cout<<"                        "<<char(5)<<" Game Tebak Angka "<<char(5)<<endl<<endl;
cout<<"                           - LEVEL EASY - "<<endl<<endl<<endl;
cout<<"   Hello, [ "<<nama_user<<" ]"<<endl;
cout<<"   Selamat bermain,semoga sukses... "<<char(1)<<endl<<endl;
int angkaacak = rand () % 50+1;
int tebakkan;
int coba = 0;
do {
cout<<"   ==> Masukkan Angka Dari 0 - 50: ";
cin >> tebakkan;
cout<<endl;
++coba;
if (tebakkan < angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU RENDAH       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (tebakkan > angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU TINGGI       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
}
while(tebakkan != angkaacak);
system("CLS");
cout << "\n\n       Anda Menebak Sebanyak [" << coba << "] Kali" << endl<<endl;
if (coba <= 5){
cout<<"             "<<char(201);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "            Very Good... "<<char(1)<<"             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (coba >= 6) {      
cout<<"             "<<char(201);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "     Not Bad, Tingkatkan lagi... "<<char(2)<<"     "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
ulang:
char pilih;
cout << "       Apakah anda ingin mengulang LEVEL EASY ??? [y] / [t] \n\n";
cout << "       ==> Masukkan Pilihan : ";
cin >> pilih;
cout<<endl;
switch (pilih )  {
case 'y':
level_01();
break;
case 't':
system("CLS");
loading01();
system("CLS");
tebak_angka();              
break;
default:
system("CLS");
loading01();
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "               PILIHAN ILEGAL  ! ! !                  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "          [ Tekan ENTER untuk kembali ]               "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
goto ulang;           
cout << endl;  
}
}   

void program::level_02(){
system("CLS");
cout<<endl<<endl;
cout<<"                        "<<char(5)<<" Game Tebak Angka "<<char(5)<<endl<<endl;
cout<<"                          - LEVEL MEDIUM - "<<endl<<endl<<endl;
cout<<"   Hello, [ "<<nama_user<<" ]"<<endl;
cout<<"   Selamat bermain,semoga sukses... "<<char(1)<<endl<<endl;
int angkaacak = rand () % 200+1;
int tebakkan;
int coba = 0;
do {
cout<<"   ==> Masukkan Angka Dari 0 - 200: ";
cin >> tebakkan;
cout<<endl;
++coba;
if (tebakkan < angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU RENDAH       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (tebakkan > angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU TINGGI       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
}
while(tebakkan != angkaacak);
system("CLS");
cout << "\n\n       Anda Menebak Sebanyak [" << coba << "] Kali" << endl<<endl;
if (coba <= 5){
cout<<"             "<<char(201);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "            Very Good... "<<char(1)<<"             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (coba >= 6) {      
cout<<"             "<<char(201);
    for(int i=1; i<40; i++){ cout<<char(205); }
    cout<<char(187)<<endl;
    cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
    cout<<"             "<<char(186)<< "     Not Bad, Tingkatkan lagi... "<<char(2)<<"     "<<char(186)<<endl;
    cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
    cout<<"             "<<char(200);
     for(int i=1; i<40; i++){ cout<<char(205); }
   cout<<char(188)<<endl<<endl;
}
ulang:
char pilih;
cout << "       Apakah anda ingin mengulang LEVEL MEDIUM ??? [y] / [t] \n\n";
cout << "       ==> Masukkan Pilihan : ";
cin >> pilih;
cout<<endl;
switch (pilih )  {
case 'y':
level_02();
break;
case 't':
system("CLS");
loading01();
system("CLS");
tebak_angka();              
break;
default:
system("CLS");
loading01();
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "               PILIHAN ILEGAL  ! ! !                  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "          [ Tekan ENTER untuk kembali ]               "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
goto ulang;           
cout << endl;  
}
}

void program::level_03(){
system("CLS");
cout<<endl<<endl;
cout<<"                        "<<char(5)<<" Game Tebak Angka "<<char(5)<<endl<<endl;
cout<<"                            - LEVEL HARD - "<<endl<<endl<<endl;
cout<<"   Hello, [ "<<nama_user<<" ]"<<endl;
cout<<"   Selamat bermain,semoga sukses... "<<char(1)<<endl<<endl;
int angkaacak = rand () % 1000+1;
int tebakkan;
int coba = 0;
do {
cout<<"   ==> Masukkan Angka Dari 0 - 1000: ";
cin >> tebakkan;
cout<<endl;
++coba;
if (tebakkan < angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU RENDAH       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (tebakkan > angkaacak){
cout<<"             "<<char(201);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "       TERLALU TINGGI       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<29; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
}
while(tebakkan != angkaacak);
system("CLS");
cout << "\n\n       Anda Menebak Sebanyak [" << coba << "] Kali" << endl<<endl;
if (coba <= 5){
cout<<"             "<<char(201);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "            Very Good... "<<char(1)<<"             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
if (coba >= 6) {       
cout<<"             "<<char(201);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(186)<< "     Not Bad, Tingkatkan lagi... "<<char(2)<<"     "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                       "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<40; i++){ cout<<char(205); }
cout<<char(188)<<endl<<endl;
}
ulang:
char pilih;
cout << "       Apakah anda ingin mengulang LEVEL HARD ??? [y] / [t] \n\n";
cout << "       ==> Masukkan Pilihan : ";
cin >> pilih;
cout<<endl;
switch (pilih )  {
case 'y':
level_03();
break;
case 't':
system("CLS");
loading01();
system("CLS");
tebak_angka();              
break;
default:
system("CLS");
loading01();
system("CLS");    
loading01();
system("CLS");    
loading01();
system("CLS");
cout<<"\n\n\n\n\n\n\n"<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "               PILIHAN ILEGAL  ! ! !                  "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "          [ Tekan ENTER untuk kembali ]               "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
system("pause");
system("CLS");
cout<<"\n\n\n\n\n\n\n\n\n"<<endl;
goto ulang;           
cout << endl;  
}
}

int main(int argc, char *argv[])
{
cout<<endl<<endl;
cout<<"             "<<char(201);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(187)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "              - DASAR-DASAR PEMROGRAMAN -             "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       Created by :                                   "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       1. Indra Dwi Ananto       [ 09018107 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       2. Ilham Nurfuadi         [ 09018115 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "       3. Satuhu Suseta Prasetya [ 09018143 ]         "<<char(186)<<endl;
cout<<"             "<<char(186)<< "                                                      "<<char(186)<<endl;
cout<<"             "<<char(200);
for(int i=1; i<55; i++){ cout<<char(205); }
cout<<char(188)<<endl;
program panggil;
panggil.tampilan_awal();
system("PAUSE");
return EXIT_SUCCESS;
}


Alhamdulillah sudah selesai programnya sob, semoga bermanfaat dan jangan lupa selamat belajar biyar lebih kreatif lagi untuk membuatnya . . . 

jangan lupa join + comentnya . .

Share this article :

3 komentar:

  1. ijin berbagi untuk program game yang saya buat

    http://heriadyblog.blogspot.com/p/isi-blog-ini.html
    http://heriadyblog.blogspot.com/p/blog-page_19.html

    BalasHapus
  2. Komentar ini telah dihapus oleh pengarang.

    BalasHapus

English French German Spain Italian Japanese Korean Chinese Simplified

Tweets

FunsPage

 
Support : Creating Website | media-template | sahrul Template
Proudly powered by Blogger
Copyright © 2011. MEDIA BELAJAR - All Rights Reserved
Template Design by Creating Website Published by sahrul-media