Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Compare(List* listS1, List* listS2, List* listS3)
- {
- bool _break3 = false;
- bool cycled = false;
- int cs1 = 0;
- int cs2 = 0;
- int cs3 = 0;
- Blocks* bss1 = get(listS1).blocks;
- Blocks* bss2 = get(listS2).blocks;
- Blocks* bss3 = get(listS3).blocks;
- Block bs1 = get(bss1);
- Block bs2 = get(bss2);
- Block bs3 = get(bss3);
- while (!_break3)
- {
- bool _break2 = false;
- while (!_break2)
- {
- bool _break1 = false;
- while (!_break1)
- {
- bool _br1 = false;
- bool _br2 = false;
- char is1 = bs1.array[cs1];
- char is2 = bs2.array[cs2];
- char is3 = bs3.array[cs3];
- if (is3 == '\0') {
- if (cs3 != 0)
- return true;
- if (cs3 == 0)
- return false;
- }
- if (is2 > is1)
- {
- cs1++;
- if (is1 == is3)
- {
- cs3++;
- }
- else
- {
- if (is1 > is3)
- {
- return false;;
- }
- }
- }
- else
- {
- if (is1 == is2)
- {
- if (is1 == is3)
- {
- cs3++;
- }
- cs1++;
- cs2++;
- }
- else
- {
- if (is1 > is2)
- {
- cs2++;
- if (is2 == is3)
- {
- cs3++;
- }
- else
- {
- if (is2 > is3)
- {
- return false;
- }
- }
- }
- }
- }
- if (cs2 >= bs2.count)
- {
- cs2 = 0;
- if (move(bss2, true))
- {
- bs2 = get(bss2);
- _break1 = true;
- }
- else
- if (move(listS2, true))
- {
- _break2 = true;
- bss2 = get(listS2).blocks;
- bs2 = get(bss2);
- break;
- }
- else
- {
- if (cycled)
- {
- cs1++;
- cycled = false;
- _br2 = true;
- }
- cs2 = bs2.count - 1;
- cycled = true;
- }
- }
- if (cs1 >= bs1.count)
- {
- cs1 = 0;
- if (move(bss1, true))
- {
- bs1 = get(bss1);
- _break1 = true;
- }
- else
- if (move(listS1, true))
- {
- _break2 = true;
- bss1 = get(listS1).blocks;
- bs1 = get(bss1);
- break;
- }
- else
- {
- if (!cycled)
- return false;
- _br1 = true;
- }
- }
- if (cs3 >= bs3.count)
- {
- cs3 = 0;
- if (move(bss3, true))
- {
- bs3 = get(bss3);
- _break1 = true;
- }
- else
- if (move(listS3, true))
- {
- _break2 = true;
- bss3 = get(listS3).blocks;
- bs3 = get(bss3);
- break;
- }
- else
- {
- return true;
- }
- }
- if (_br1 && _br2)
- return false;
- if (_break3)
- break;
- }
- if (_break3)
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment