Selasa, 09 Desember 2014

Membuat Game Batu Kertas Gunting Borland C++

02.45



#include<conio.h>
#include<iostream.h>
main()
{
float playera, playerb ;
cout<<"\\     KERTAS BATU GUNTING   \\\n";
cout<<"==============================\n";
cout<<"Keterangan :\n";
cout<<"Batu    = [1]\n";
cout<<"Kertas  = [2]\n";
cout<<"Gunting = [3]\n";
cout<<"==============================\n";
cout<<"Masukkan pilihan player (A):";
cin>>playera;
cout<<"Masukkan pilihan player (B):";
cin>>playerb;
cout<<"\n";
if (playera == 1 && playerb == 1)
   cout<<"DRAW!..."<<endl;
   else
   if (playera == 1 && playerb == 2)
   cout<<"PLAYER (B) MENANG!..."<<endl;
   else
   if (playera == 1 && playerb == 3)
   cout<<"PLAYER (A) MENANG!..."<<endl;
   else
   if (playera == 2 && playerb == 1)
   cout<<"PLAYER (A) MENANG!..."<<endl;
   else
   if (playera == 2 && playerb == 2)
   cout<<"DRAW!..."<<endl;
   else
   if (playera == 2 && playerb == 3)
   cout<<"PLAYER (B) MENANG!..."<<endl;
   else
   if (playera == 3 && playerb == 1)
   cout<<"PLAYER (B) MENANG!..."<<endl;
   else                                                                        
   if (playera == 3 && playerb == 2)
   cout<<"PLAYER (A) MENANG!..."<<endl;
   else
   if (playera == 3 && playerb == 3)
   cout<<"DRAW!..."<<endl;
getch();
}

http://biokom-pti.blogspot.com/2014/02/borland-c-membuat-game-batu-kertas.html

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

1 komentar:

  1. http://aka-compile.blogspot.co.id/2010/12/membuat-game-batugunting-kertas-dengan.html

    BalasHapus

 

© 2013 Wawasan Bersama. All rights resevered. Designed by Templateism

Back To Top