Hamikadze

Untitled

May 17th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.61 KB | None | 0 0
  1. bool Compare(List* listS1, List* listS2, List* listS3)
  2. {
  3.     bool _break3 = false;
  4.     bool cycled = false;
  5.     int cs1 = 0;
  6.     int cs2 = 0;
  7.     int cs3 = 0;
  8.     Blocks* bss1 = get(listS1).blocks;
  9.     Blocks* bss2 = get(listS2).blocks;
  10.     Blocks* bss3 = get(listS3).blocks;
  11.     Block bs1 = get(bss1);
  12.     Block bs2 = get(bss2);
  13.     Block bs3 = get(bss3);
  14.     while (!_break3)
  15.     {
  16.         bool _break2 = false;
  17.         while (!_break2)
  18.         {
  19.             bool _break1 = false;
  20.             while (!_break1)
  21.             {
  22.                 bool _br1 = false;
  23.                 bool _br2 = false;
  24.                 char is1 = bs1.array[cs1];
  25.                 char is2 = bs2.array[cs2];
  26.                 char is3 = bs3.array[cs3];
  27.                 if (is3 == '\0') {
  28.                     if (cs3 != 0)
  29.                         return true;
  30.                     if (cs3 == 0)
  31.                         return false;
  32.                 }
  33.                 if (is2 > is1)
  34.                 {
  35.                     cs1++;
  36.                     if (is1 == is3)
  37.                     {
  38.                         cs3++;
  39.                     }
  40.                     else
  41.                     {
  42.                         if (is1 > is3)
  43.                         {
  44.                             return false;;
  45.                         }
  46.                     }
  47.                 }
  48.                 else
  49.                 {
  50.                     if (is1 == is2)
  51.                     {
  52.                         if (is1 == is3)
  53.                         {
  54.                             cs3++;
  55.                         }
  56.                         cs1++;
  57.                         cs2++;
  58.                     }
  59.                     else
  60.                     {
  61.                         if (is1 > is2)
  62.                         {
  63.                             cs2++;
  64.                             if (is2 == is3)
  65.                             {
  66.                                 cs3++;
  67.                             }
  68.                             else
  69.                             {
  70.                                 if (is2 > is3)
  71.                                 {
  72.                                     return false;
  73.                                 }
  74.                             }
  75.                         }
  76.                     }
  77.                 }
  78.                 if (cs2 >= bs2.count)
  79.                 {
  80.                     cs2 = 0;
  81.                     if (move(bss2, true))
  82.                     {
  83.                         bs2 = get(bss2);
  84.                         _break1 = true;
  85.                     }
  86.                     else
  87.                         if (move(listS2, true))
  88.                         {
  89.                             _break2 = true;
  90.                             bss2 = get(listS2).blocks;
  91.                             bs2 = get(bss2);
  92.                             break;
  93.                         }
  94.                         else
  95.                         {
  96.                             if (cycled)
  97.                             {
  98.                                 cs1++;
  99.                                 cycled = false;
  100.                                 _br2 = true;
  101.                             }
  102.                             cs2 = bs2.count - 1;
  103.                             cycled = true;
  104.                         }
  105.                 }
  106.  
  107.                 if (cs1 >= bs1.count)
  108.                 {
  109.                     cs1 = 0;
  110.                     if (move(bss1, true))
  111.                     {
  112.                         bs1 = get(bss1);
  113.                         _break1 = true;
  114.                     }
  115.                     else
  116.                         if (move(listS1, true))
  117.                         {
  118.                             _break2 = true;
  119.                             bss1 = get(listS1).blocks;
  120.                             bs1 = get(bss1);
  121.                             break;
  122.                         }
  123.                         else
  124.                         {
  125.                             if (!cycled)
  126.                                 return false;
  127.                             _br1 = true;
  128.                         }
  129.                 }
  130.                 if (cs3 >= bs3.count)
  131.                 {
  132.                     cs3 = 0;
  133.                     if (move(bss3, true))
  134.                     {
  135.                         bs3 = get(bss3);
  136.                         _break1 = true;
  137.                     }
  138.                     else
  139.                         if (move(listS3, true))
  140.                         {
  141.                             _break2 = true;
  142.                             bss3 = get(listS3).blocks;
  143.                             bs3 = get(bss3);
  144.                             break;
  145.                         }
  146.                         else
  147.                         {
  148.                             return true;
  149.                         }
  150.                 }
  151.                 if (_br1 && _br2)
  152.                     return false;
  153.                 if (_break3)
  154.                     break;
  155.             }
  156.             if (_break3)
  157.                 break;
  158.         }
  159.     }
  160. }
Advertisement
Add Comment
Please, Sign In to add comment