Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <window.h>
- using namespace std;
- int_main()
- {
- char jwb1,jwb2,pil;
- ulang :
- cout<<“Selamat datang di game GBK”<<endl;
- cout<<“peraturan main :”<<endl;
- cout<<“1. G = gunting “<<endl;
- cout<<“2. B = batu “<<endl;
- cout<<“3. K = kertas “<<endl<<endl;
- cout<<“Player 1 silahkan masukan pilihan anda (G/B/K) = “;
- cin>>jwb1;
- cout<<“Tekan enter untuk lanjut”<<endl;
- system(“pause);
- system(“cls”);
- cout<<“Selamat datang di game GBK”<<endl;
- cout<<“peraturan main :”<<endl;
- cout<<“1. G = gunting “<<endl;
- cout<<“2. B = batu “<<endl;
- cout<<“3. K = kertas “<<endl<<endl;
- cout<<“Player 2 silahkan masukan pilihan anda (G/B/K) = “;
- cin>>jwb2;
- cout<<“Tekan enter untuk lanjut”<<endl;
- system(“pause);
- system(“cls”);
- if (jwb1 == ‘g’ || jwb1 == ‘G’)
- {
- if (jwb2 == ‘g’ ||jwb2 == ‘G’)
- {
- cout<<“P1 = Gunting”<<endl;
- cout<<“P2 = Gunting”<<endl;
- cout<<“Draw”<<endl;
- }
- if (jwb2 == ‘b’ ||jwb2 == ‘B’)
- {
- cout<<“P1 = Gunting”<<endl;
- cout<<“P2 = Batu”<<endl;
- cout<<“P2 win”<<endl;
- }
- if (jwb2 == ‘k’ ||jwb2 == ‘K’)
- {
- cout<<“P1 = Gunting”<<endl;
- cout<<“P2 = Kertas”<<endl;
- cout<<“P1 win”<<endl;
- }
- }
- if (jwb1 == ‘b’ || jwb1 == ‘B’)
- {
- if (jwb2 == ‘g’ ||jwb2 == ‘G’)
- {
- cout<<“P1 = Batu”<<endl;
- cout<<“P2 = Gunting”<<endl;
- cout<<“P1 win”<<endl;
- }
- if (jwb2 == ‘b’ ||jwb2 == ‘B’)
- {
- cout<<“P1 = Batu”<<endl;
- cout<<“P2 = Batu”<<endl;
- cout<<“Draw”<<endl;
- }
- if (jwb2 == ‘k’ ||jwb2 == ‘K’)
- {
- cout<<“P1 = Batu”<<endl;
- cout<<“P2 = Kertas”<<endl;
- cout<<“P2 win”<<endl;
- }
- }
- if (jwb1 == ‘k’ || jwb1 == ‘K’)
- {
- if (jwb2 == ‘g’ ||jwb2 == ‘G’)
- {
- cout<<“P1 = Kertas”<<endl;
- cout<<“P2 = Gunting”<<endl;
- cout<<“P2 win”<<endl;
- }
- if (jwb2 == ‘b’ ||jwb2 == ‘B’)
- {
- cout<<“P1 = Kertas”<<endl;
- cout<<“P2 = Batu”<<endl;
- cout<<“P1 win”<<endl;
- }
- if (jwb2 == ‘k’ ||jwb2 == ‘K’)
- {
- cout<<“P1 = Kertas”<<endl;
- cout<<“P2 = Kertas”<<endl;
- cout<<“Draw”<<endl;
- }
- }
- cout<<endl<<endl;
- cout<<“Apakah anda ingin mengulang lagi (Y/N) ? “;
- cin>>pil;
- if(pil==’y’ ||pil==’Y’)
- {
- goto ulang;
- }
- if (pil == ‘n’ || pil == ‘N’)
- {
- cout<<“Terimakasih telah memainkan game GBK”<<endl;
- system(“pause”);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement