Advertisement
Guest User

bitwa

a guest
Dec 8th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.82 KB | None | 0 0
  1. if(a==b)
  2.             {
  3.                 showoff(a, c);
  4.                 cout<<" BATTLES  ";
  5.                 showoff(b, d);
  6.                 cout<<endl;
  7.                 while(f!=true){
  8.                     a=handone[t];
  9.                     c=kolorone[t];
  10.                     b=handtwo[t];
  11.                     d=kolortwo[t];
  12.                     if(a==b){
  13.                         t=t+2;
  14.                         showoff(a, c);
  15.                         cout<<" BATTLES  ";
  16.                         showoff(b, d);
  17.                         cout<<endl;
  18.                     }
  19.                     if(a>b){
  20.                         showoff(a, c);
  21.                         cout<<" WON !!"<<endl;
  22.                         f=true;
  23.                         for(int i=0;i<=t;i++){
  24.                             h=handone[0];
  25.                             j=kolorone[0];
  26.                             z=1;
  27.                             for(p=0;p<g;p++){
  28.                                 if(z==g)
  29.                                     {
  30.                                         handone[p]=h;
  31.                                         kolorone[p]=j;
  32.                                     }
  33.                                     else
  34.                                     {
  35.                                         handone[p]=handone[z];
  36.                                         kolorone[p]=kolorone[z];
  37.                                         z++;
  38.                                     }
  39.                                 }
  40.                             }
  41.                         for(int i=0;i<=t;i++){
  42.                             handone[g]=handtwo[i];
  43.                             kolorone[g]=kolortwo[i];
  44.                             g++;
  45.                            
  46.                         }
  47.                          for(int i=0;i<=t;i++){
  48.                             z=1;
  49.                             for(p=0;p<x;p++){
  50.                                         handtwo[p]=handtwo[z];
  51.                                         kolortwo[p]=kolortwo[z];
  52.                                         z++;
  53.                                     }
  54.                              x--;
  55.                                 }
  56.                         showhand(handone, handtwo, x, g, kolorone, kolortwo);
  57.                             }
  58.                     if(b>a){
  59.                     showoff(b, d);
  60.                     cout<<" WON !!"<<endl;
  61.                     f=true;
  62.                     for(int i=0;i<=t;i++){
  63.                         h=handtwo[0];
  64.                         j=kolortwo[0];
  65.                         z=1;
  66.                         for(p=0;p<x;p++){
  67.                             if(z==x)
  68.                                 {
  69.                                     handtwo[p]=h;
  70.                                     kolortwo[p]=j;
  71.                                 }
  72.                                 else
  73.                                 {
  74.                                     handtwo[p]=handtwo[z];
  75.                                     kolortwo[p]=kolortwo[z];
  76.                                     z++;
  77.                                 }
  78.                             }
  79.                         }
  80.                     for(int i=0;i<=t;i++){
  81.                         handtwo[x]=handone[i];
  82.                         kolortwo[x]=kolorone[i];
  83.                         x++;
  84.                        
  85.                     }
  86.                      for(int i=0;i<=t;i++){
  87.                         z=1;
  88.                         for(p=0;p<g;p++){
  89.                                     handtwo[p]=handtwo[z];
  90.                                     kolortwo[p]=kolortwo[z];
  91.                                     z++;
  92.                                 }
  93.                          g--;
  94.                             }
  95.                         showhand(handone, handtwo, x, g, kolorone, kolortwo);
  96.                 }
  97.                 }
  98.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement