Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void hati();
- void hati2();
- string cinta;
- int main(){
- string cinta2;
- cout<<"Aku punya permainan nih dit"<<endl;
- cout<<"Jawaban cuma bisa digunakan satu kali saja ya"<<endl<<endl;
- cout<<"Ini adalah kartumu"<<endl;
- cout<<"Y / T"<<endl<<endl;
- cout<<"Apakah kamu mencintaiku dit?"<<endl;
- cout<<"Masukkan jawabanmu : ";
- cin>>cinta;
- if(cinta=="y" || cinta=="Y"){
- cout<<endl<<"Ku sayang kamu"<<endl;
- hati();
- }
- else{
- cout<<"Apakah aku tampan : ";
- cin>>cinta2;
- if(cinta2=="y" || cinta2=="Y"){
- cout<<endl<<"Kenapa kamu menolakku dit :'( :'( "<<endl<<"Apa aku terlalu baik buat kamu ya..";
- hati();
- }
- else{
- hati();
- }
- }
- }
- void hati2(int a=-1, int b=-1, int c=-1, int d=-1){
- for(int i=0;i<=39;i++){
- if(i==a || i==b || i==c || i==d){
- cout<<"*";
- }
- else{
- cout<<" ";
- }
- }
- cout<<endl;
- }
- void hati(){
- int x=-1;
- int a[29][4]={{10,30,x,x},{9,11,29,31},{8,12,28,32},{7,13,27,33},{6,14,26,34},{5,15,25,35},{4,16,24,36},{3,17,23,37},{2,18,22,38},{1,19,21,39},{2,18,20,38},{3,17,19,37},{4,18,20,36},{5,19,21,35},{6,18,20,34},{7,17,19,33},{8,18,20,32},{9,19,21,31},{10,18,20,30},{11,17,19,29},{12,18,20,28},{13,19,21,27},{14,18,20,26},{15,17,19,25},{16,18,20,24},{17,19,21,23},{18,18,20,22},{19,21,x,x},{20,x,x,x}};
- int b[29][4]={{10,30,x,x},{9,11,29,31},{8,12,28,32},{7,13,27,33},{6,14,26,34},{5,15,25,35},{4,16,24,36},{3,17,23,37},{2,18,22,38},{1,19,21,39},{2,20,38,x},{3,37,x,x},{4,36,x,x},{5,35,x,x},{6,34,x,x},{7,33,x,x},{8,32,x,x},{9,31,x,x},{10,30,x,x},{11,29,x,x},{12,28,x,x},{13,27,x,x},{14,26,x,x},{15,25,x,x},{16,24,x,x},{17,23,x,x},{18,22,x,x},{19,21,x,x},{20,x,x,x}};
- int c[29][4];
- memcpy(c, b,sizeof b);
- if(cinta=="t" || cinta=="T"){
- memcpy(c, a,sizeof a);
- cout<<endl<<"Hancurnya hatiku.."<<endl;
- }
- cout<<endl;
- for(int i=0;i<29;i++){
- hati2(c[i][0],c[i][1],c[i][2],c[i][3]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement