Advertisement
Guest User

yyy

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