diff --git a/comptetive-programming/adventofcode2020/19-12-2.txt b/comptetive-programming/adventofcode2020/19-12-2.txt new file mode 100644 index 0000000..3f28c87 --- /dev/null +++ b/comptetive-programming/adventofcode2020/19-12-2.txt @@ -0,0 +1,501 @@ +62: 110 112 | 92 68 +85: 38 92 | 102 110 +63: 92 6 | 110 23 +82: 110 | 92 +99: 110 122 | 92 54 +33: 110 61 | 92 103 +24: 110 92 | 110 110 +76: 3 92 +109: 26 92 | 81 110 +94: 92 78 | 110 28 +17: 110 115 +61: 92 110 | 110 82 +25: 9 110 | 61 92 +114: 47 110 | 63 92 +21: 30 82 +103: 82 82 +69: 5 110 | 43 92 +73: 110 116 | 92 69 +52: 92 81 | 110 103 +22: 119 92 | 50 110 +108: 37 92 | 35 110 +2: 71 92 | 20 110 +119: 103 110 | 88 92 +102: 101 92 | 49 110 +92: "b" +91: 92 54 | 110 3 +64: 92 115 | 110 24 +68: 92 30 | 110 81 +89: 115 110 | 26 92 +80: 61 110 | 81 92 +19: 110 73 | 92 1 +16: 115 92 | 103 110 +15: 123 110 | 58 92 +115: 110 110 | 92 110 +70: 92 30 | 110 9 +40: 110 96 | 92 99 +50: 88 110 | 115 92 +18: 26 92 | 48 110 +81: 92 110 +107: 110 30 | 92 115 +38: 84 110 | 12 92 +44: 40 92 | 66 110 +27: 125 92 | 2 110 +41: 92 128 | 110 118 +56: 81 92 | 30 110 +88: 110 92 +13: 75 92 +55: 75 110 | 26 92 +12: 13 92 | 52 110 +28: 122 92 +121: 75 92 | 24 110 +113: 92 81 | 110 54 +98: 103 110 | 3 92 +6: 92 62 | 110 126 +96: 75 92 | 9 110 +9: 82 92 | 92 110 +0: 8 11 +32: 104 92 | 91 110 +116: 110 32 | 92 67 +104: 92 81 | 110 30 +5: 110 109 | 92 105 +117: 110 22 | 92 59 +128: 92 24 | 110 9 +66: 92 98 | 110 21 +46: 76 92 | 89 110 +36: 92 90 | 110 127 +20: 110 115 | 92 3 +4: 48 110 | 30 92 +26: 92 82 | 110 110 +39: 30 110 | 115 92 +127: 61 110 | 9 92 +84: 110 104 | 92 78 +100: 97 92 | 68 110 +106: 110 7 | 92 18 +123: 110 64 | 92 68 +111: 110 74 | 92 46 +42: 114 110 | 19 92 +58: 28 92 | 16 110 +47: 110 15 | 92 124 +54: 92 92 | 110 92 +51: 110 117 | 92 111 +130: 92 41 | 110 106 +30: 92 92 | 110 110 +72: 17 110 | 109 92 +129: 130 92 | 108 110 +14: 85 110 | 51 92 +53: 87 92 | 44 110 +112: 92 30 | 110 122 +45: 61 82 +105: 75 92 | 61 110 +90: 110 122 | 92 9 +122: 110 92 | 92 110 +83: 110 33 | 92 56 +118: 110 61 | 92 75 +74: 120 92 | 78 110 +29: 110 65 | 92 60 +31: 14 92 | 10 110 +110: "a" +87: 36 110 | 94 92 +57: 92 48 | 110 81 +78: 92 115 | 110 54 +97: 92 48 | 110 122 +1: 110 27 | 92 34 +95: 92 107 | 110 86 +79: 110 55 | 92 77 +37: 92 109 | 110 25 +126: 4 110 | 39 92 +101: 45 92 | 80 110 +59: 110 70 | 92 105 +7: 61 92 | 48 110 +48: 92 92 +35: 104 92 | 57 110 +120: 48 92 | 48 110 +34: 29 110 | 79 92 +93: 54 92 | 26 110 +71: 115 110 | 61 92 +125: 121 110 | 45 92 +60: 122 92 | 54 110 +86: 54 110 | 9 92 +49: 97 110 | 91 92 +3: 110 110 +23: 110 95 | 92 72 +65: 92 103 | 110 115 +10: 129 110 | 53 92 +8: 42 | 42 42 | 42 42 42 | 42 42 42 42 | 42 42 42 42 42 | 42 42 42 42 42 42 | 42 42 42 42 42 42 42 | 42 42 42 42 42 42 42 42 | 42 42 42 42 42 42 42 42 42 | 42 42 42 42 42 42 42 42 42 42 +11: 42 31 | 42 42 31 31 | 42 42 42 31 31 31 | 42 42 42 42 31 31 31 31 | 42 42 42 42 42 31 31 31 31 31 | 42 42 42 42 42 42 31 31 31 31 31 31 +77: 103 92 | 81 110 +67: 93 92 | 112 110 +75: 92 110 | 92 92 +124: 83 110 | 100 92 +43: 92 113 | 110 56 + +abbabbbbaaabbbbabbbababaaabaabaabbaabbba +babaaaabbaaabbbbbbbbbaba +bbbbaaaabaaabbabaababbbabaaaaaababaabaaaaabbabbb +baabbbbbbbaababaababbbabbababbbbaaaabbbbbabaabbabaaababb +aabbaabbbbbaabbbbaaabaab +bbaaabbaaaabababbbbaabaa +abbbbbababbaabaabaaaabbbaaaabaab +abaabbbbabaaabaabbbbaabbabaabaaabbaaabbbabbaabbbaabbbabb +baabbbbbaabbaaabbabbabaa +babbabbbabaabaaaaabbababaaaabaaaabbababbabababbaaababaaa +aaababaabababbbbabaaaaab +bbabaabaabbaabaabbbbbbab +bbbbaaaabaaabbabbbbbbaababaabbaabaabbaab +aaabbabbbabababbaabbabba +abbbbbbabbababbbbabbabbabbabaabbaaabbaab +bbbbabaaabbaabbabaaabbbababababbabaabbaabbabbbaa +aabaaaaabaabaaabaaabbaababbbaaababbbbbbabbbbabababbbabbaabaaabaa +baaaababbaaaaaabaabbbabbaaabaaab +abbabbbaaabaaabbaaaaabbb +ababaaaababaaaaaaababbaa +babbabbabbababababbaaabb +bbabbaabaaabbabbababaaababababaaaaababaabbaababb +bbababbbbbabaaabaaabaaaa +abbaaabaaaabaabbbbbaaaba +aaaabababbbbabaabaabaaabbabbabbabaaababaaabaabbaabaaabbabbaaaabababbbaab +aabaababaaaaaabbaabaaabbbabbbaaabaabaaaaabbaaaba +bababaaaabbaabbbaaaabbab +abababaabbbbbaababbaaaabbabaabbbabbbbaaaabaaabbbabbbbaba +ababababababbbaaababbbba +ababbabbabaabbbaabaaaabbaaaaaaaaaaabaaaabbbababb +aaabbabbbaaabaaaabaabaaa +abbbbabbabbbbaaabbbbabbbbabaaaababbbabaababbaabbabaaabba +bbbababaaaaabaaabaabaaabbaababba +aaaabbbbbbabababbbaaabab +aabaababbbbbaabaabaaabaaabababbbbababbabbbbabbaa +babbabbaabababaaabbbabaa +baaaaaaabbabababbbaabaaa +aaababaaaaabaaaaabaaabbaabaaaaab +abaaabaabaaabaabaaabaaaabbaabaaabbbbbbab +aaabbbabaababbbbbaabaaba +bababbbaabababaabababaab +bababbbaaaabaaaabbbaaabbabbaaabb +ababaaabbababaaabbabbbbabaabaabaabaababb +bbabbaabbabaabbbabbabbbaaabbaabaaaaaaaababbbbaaaabbaabab +aaababababaaaabbaaaaabba +babaababbbbabababaabaaaaababbabaabaaabba +aaaabaaaabababaaaaabbaaa +aabaaaaababbbaaaabbbabababbabbaa +bbbbaababaabbbabbbbabbaa +baaaaaabaabaaaaaabbaabbaabbabbbbbbbabbabbbbbabbbabaabbab +ababababbaaaaaabaabaabbb +abbbababababbbaababbaabb +aabbaaabaabbaabbaaaaaabbbbaaabbaabbbaaaa +bbabbbbaaababaababbbbbbaabbbbbabbabbabbb +babbbabaabaabbbabaabbaab +bbabbbabababbbabaababbbaaabaaaababbbbaba +babbaaaabbbabbbbabbaaaba +bbbbababbbababbbbbabbbabbbaabbbbaaabbaaa +ababbbaababbbabaaaaaaabaabaaaaaabbabaabbaaaaaabababaaabaaaaaababbbbabbbbaababbaabbbbaaab +aabbbabbaabbaabbbaaabababaaabaabbbabbaba +bbbabaabbbabbaabbaabaaaababbababababbbba +abaabbbabaaaaabbabaaabbb +bababbabaabaabaaaabbbbaabbababba +aabbaaabaabbbabbaababaaa +baababbbbbabaabaaaaabbab +bbbbabbaabbbbbbbabbbaaaaaaabaabababaaaaaabababbbbaababab +baaaabbabbaaaaaababaaaaaabaabbbbababbbbb +baababbbabbbbaaabbaabaaa +bbbabbabbbbbabbbbaaaaaaaaaabbabaabaababb +bbbbbbaabaabbbaaabbbaaba +bbbababaaabbbbbbbbbbababaabaabaababbbbba +abbaabbaabbaaaababaaaaababaabaaaaabbbaabaabaaaabaabbabbbbabaabba +baaaabbbaaabbaabaabbbabababbaaab +abaaabaaabababaababbbbbb +bbbbaaaabbabaabaabaaabaabaabbaaa +bbaaabbbbaaaaaaabaabbbbbbbbaabbbaaaaabbb +abbaabbabaaabbabaaabbbbabbababba +baabaaaaaabbabaaaabaabbbbaabbaab +babbbababaaababaabaabbaa +aabbbbaaababbbaaabaaaaab +bbaaabbbaabaaabaabbbabba +babbbaaabababaaababbbaab +aaaaaaaaabbbababaaabbaab +bbaabaabbabbbaaababbbaaabbbbbaabbbababba +ababababbaaabbabbababbbbbbbbabba +abbaabbababbbabaabbabbbabbaaaaababbbabababaabbaa +aabbbabaaaabbbbbababbbbbbabbaaabbabaababaabbabab +babbbaaababaabbbbbbabbaa +ababaabaaabbaaababaabbbb +aabaabaaaabbbbaaaabbabaa +baaaabbbbbbababbaabaababaabbabaaababbbbabaaabbbbbbbaaabbabbbbbbaaaaaaabaaaaaabbbbbbaaaba +baaabbabbabbbabaaaabaaba +baaaabbbbbbbbaababbbbbbb +baaaabbaaabbbbbbaababaaa +aabaababbaaaababaabbabba +aabbbbaaaabbaaaabaababba +bbaaabaaaaaabbbabbabaabababbabbaaababbababaabbab +abbabbbaaabaaabbabbabbaa +aaaaabbbbbbbbbbbabaababbababbbbabbbabbbaabaababb +bbbbababbbabaabababbbabaaabaabababaaaabbabaabbabbbaabbab +babbbabbbababbbbabbaabbbabaaaabbbbabbaabaabbabaaabbbbaab +baabaabbaaababbaaababbbbbbaaabbbabaaaaabbbbbaaabbbbaaaaa +abaaababaaaabababbaabbab +abababaaaaaabaaababbabba +abbbaaabbaabbbbbbaaababb +baabbbbbbbbbabbbbbaabbba +abaaabaaabbbbbabbbbabbba +babbbabbaabaabaaabaaaaaa +aaabbabbabaaababbbbabbabbabaaaabaabbababbbbbabba +aabaaaaaababaaaabababaaaabbbbbbababbaabaabbbaaaa +abaaaabbbbbabaaaaabbbbababaabaaa +aaabbbabaaaabaaaabbabbab +bbbbaabbbabbbabbbaaabbbabaabaabbbabbabbbabaaabbaabbababb +babaabbbbbbbababbbaabaababbaaabb +abbbbabbbbbbbbbababbaabb +abaaaabbaabbbbaabaabbbbbbabbabbababbbbbbabbabbaabababaab +aaabbabbaaaabbbaabbbabaa +babbbabaabababaaababbaba +abbaabbababaaaaaaababaaa +aabbbabbabababbbabbbbbaa +aababbbbbaaaaabbbaabbaab +aabbaabaaabaabaaaabbbaab +abaabbbabababaaaaabababb +abbbbbbaabaaabaababbabbb +baabaaaaaaabbabaaabbaabbaabbaaab +baababbaababbaabbbbabbaa +ababababbabaaaabbaaabaab +abbabbbbabbbababaabababb +bbabbabbbbabaaabaabbbbba +aaaaaabbbaaaaabbabbababb +baaabaaababbbabaaababbbbbbaabbab +bbbbbbbababaababaababbaa +baaaaaaaabaabbbaababbabbbaaaaaabbaabaaaaababbbbaaabaabaa +aaabbbabbaaaabbbbabbbabababaaabababaabba +bbbabbabababbabbbabaaabb +bbaaabaaaaaaaaaababaaabb +aabaabbaaabbbaabbaaabaaaababbaab +abbbbaaabbabbbbbbbbbbbaabbabbabbbabbbbab +aaababaabaababaabbbaabab +baabaabbbbabbbabababbaaa +abbbaaabaabaababbbbbababababbaabbabaaaaaabbbbbaa +aabbbbbbbbbabbbbabaabaab +bababaaabbbabbbbababbaba +bbabaabbbababaaabaaaaabb +bbbbbbaababaababababbbbb +bababbbbabbbbbabbaabaaba +aabaababbbbbbbbabaabbbabbbabbbabbbabbaabaabaaabbababbaba +ababbbabbaaabbabababbbbbababaabaaabaabaabbbaaaaaaaaabbaabbbababbaaabbabbbbaabbaa +bbabbbabaaabbabaabaabaaa +bbabbaabbbaaaaabababbbbb +bbbbbbaaababbabbaababbaa +bbbbbbaabbabababaaaabaab +abbaaabbabbababbabababbaaabbbbababbaabbbabbbbbab +bbbbababbabbbabbbbaabaaa +bbaabaabbababbaaaabbaaaabaaaaaba +abbaabaaababbabbabbbabaaaaaabaab +baaaababbbabbabbbbbbaabbabbaaaaabaabbbaaaaabbaaaabaaaaab +bbbbbbbabaabaaabbbabbbbaaabbbbababbaaabb +bbaaabaaabbaaaaaaaabbaaa +babaabbbabbabbbbbaaabbbbababaabb +bbbbabbbbababbbabbabbbaa +baaaaaababbaaaabbbbaabba +abbbaaabbbbbababaabbbbbb +aabbaaaaaababaabbabaabbbbabbaabaaaaaaaaaaababbab +aaabbabbbbbabababbbbbbab +babaabaabbbabaaaaaabbababaababba +abaabbbaabbbbbababaaaaab +aaabbabbaabababbaabbbbba +aabaaabaaaaabbbaabbbaabaababbbbbbbbbaabbbbbbaabbbaabbaaa +abbaabbbbaaaabbbabbbaabb +bbaaabbaaaababaabbbabaababaaaabaaabbbaabbbaababbbaababba +babaababbabaaaaaaaaaabaabbbbbaababbabbaa +bbaaabbabbabbbabaaaaabbb +aaaabababbababbbaabbbbababbaaaaabaaaaaba +bbabaabbbbbbbbbaabaaaaab +bbabaaababaaababbaaaabaa +aabbaaabaabbbabaabbbabaa +bababaaabbbbbbbabababaaaabaaaaab +abaaaabbaaaaababaaaaaaba +baaaabbaaaababababaabaabbaaaaabbbaababba +bbababbbbbaaaaabaabababb +bbbabbbbbbbbaababbbbaabaabbbbbaa +bbbabbbbabaabaaaababbbbaababaabb +bbbbababbabbbabbbabbabaa +baaabababaabbbaabbabaabababbabbaabbaabab +aaababbabaaaaaaabbbaaaba +baaaaaabaabaaabaaabaabba +babbaabababababbaaabbaaa +bbbababaaaaaaaabbbbaaaab +bababbaabbbabaabbaaaaaba +abababbbbbbbabababbabbaa +aaabbbabbaaabbabaabababa +aaaabbbababaabbbabbaaaaaabaababbbabbabab +bbaaaaababaaabaababaaaabbabaabbbaaaabbaa +abbabaabaabbaaabbababbbabaaabaab +abbbababaaabbabbaaabbaab +abbabbbbabaaababaaabbbaa +aababaababbaabbbaababbaa +babaabaaaaabaaabbbbbaaab +aababbbbbaababbbbaabbabb +bbbbaaaaabaaaaabbbbaabaabbababbabaaabbaabbbaabab +ababababbaaaabbbbbbaabbbabbbbbaa +bbabbbbbbbababbbbabbabab +bbbbbbbbbbabbaabbabbbaaaaabbbabaaabbbbba +bbabbbabaabbaaabbbbabbba +aabaabbbbbaababbaabababa +bbaabaabbbbbababbbbbbaaa +bababbaaaaaaaabbabbbbaaabbbabaababbbbababbabbbaaabbbaabb +aabbbbbbbbbbabaabbbbbaaa +ababbbaabbbaabbbbaaaaaabababaaababbbababbbabababbbaabbbb +aabbbbbbbaabbbabbbabbaaa +bababbababaaaabbabaabbab +aababbbbababababaaabbaaa +bbbbababbbabbbabbaababaa +abbbbaaabbaaabbbbaaaaabbaaaaabba +abbaabbabbaabaabbabbaabb +baaaabbbaaabbbbabaaabaab +baaabaaabbaababaaaabbaab +baabbbabbbbbbaabbabaabbbbaababab +bbabababaaabbbababaababa +aabaabaabbabbbbababbaaababbbabbbaabbabaabbbbabbabbbbbbbb +abaaaababbbbababaabababb +abbabbbbaaaabbbbabbabbbbababaabb +aababaabaaaaabaababaaaba +abbbbaaabbaaaaabaaabbaaa +aabaaabaaabbaaaaaaaabaab +bbaaabbbbbbababaaabababa +bbbabbabbaaaababbabaabbbaabbbbbbabbaaaaabbababba +bbbbababbaaaaabbabbbbbabbaabbabb +bbabaabbbbbbaabbbaabbbabaabaaaaabaabbaaa +abbaaaabbbbbabbbabaabaaa +aaabbbbaaaababbabaaaaaba +bababbaabaaaabbaaaabbaaa +ababababaaaabaaaababbaab +aabaaababbabaabaabaabbbb +abbaabbbbbbbabbbbbbbbaabbbababbbaaabbaaabbababaa +abbabbbbaaaabaaababbbabaabbbabaaaabbabaa +aababbbbbaabaabbbbbabaabaababbbbbbbbaaabbbabbaaa +babaaaabbbabbaabbaababba +bbabbbabbbbbabaabaaaabaa +aaaaaabbaabbbababaaabaab +abaaaababbbbbbaaabaabaab +abaabbbabaaaaabaaaaabbaaaaaababbabbbaabb +bbbbaaaaabbaabbabbbbabbbbbabaabaaaabaaab +bbabaaabaababbbabbababbbababbaaa +bbbbbbbbbbabaaabbaabbabb +bbbabbbbabbaabbbbaababbbabbababb +bbaaabbabaabbbaabaababab +bbabaabaabbbababbaaabbabbbbbaaab +abbbbaaaababababbabaabbbabbbbbbb +babaaaaaaabaaabababaababbabbaabbbbaabaaa +baaaabbabbaababaabbababb +aaaaaaabbaaaabbbbbbaaaaa +aabaaaaabbbabaabbaababaa +abbabaabbbabbbbbbaabaaaaaaaabbaaaaabbaab +baaaabababbbbaaabaababaa +babaaaaabaaabbbbaaabaaaa +aaabbababaaaaaaaabbbabaa +bbabaaabbaaaababaaabaaaa +bbaaabbbbabbbbbaaabbbbbaaabbbbbabbabaabababbbbbaabbabbaabbbabbbaaaaaaaababbbbababaabaabb +aabaaaaaaabababababbabaaaaabbaaa +bbbabaaabbaaaaaabbbaaaab +abaaaaaabbabaaaabbbaabbabbababaa +bbaaabbaaabbbabaababbbbb +bbabaaabbababbbababaaaabbabaaaba +abbabbbabaaabbbaaabaaaab +baaabbbbbabbbaaabbbaaabb +bbaaabbaababbbababaaabba +aaaaabaaaabbbbabaabbbbaaaababbbbbabaabbbbbabbbaa +bbaaaaaaabababbbbabbbbaa +ababbabbaabaaaaaaaababbb +babbabbabaabaaabbabaababbbbaabbbbbababababaababb +abbaaaaabababbbbaaaabababbaaaaabaabaabbb +bbaaabbbbaaaabbbaaabbaaa +bbabaaabbaaaaaaabbabbaba +bbabaabaaabaaabbbaaabababaaaabaa +bbbbababbbbabaaababbbaaaababababbaabbbaaabaabbaaaaabbbbb +bbaaaaabbbaaabaabaababab +aaaabaaabaaabbbaaababbab +aabbaababbabbbbbabbababa +baaaaaaaaabbaabaaabbbbabbaaaaaababaababb +aabbaaabababababaaaaabbb +aabaaaaabbbbaabaaaaabaab +bbaaaaabbbbabaaaabbbabba +babaaaababbabbbbbbbaaaaa +bbbbaabaaaabbbbababbaabaabbbababaabaaaabbaababba +bababbbbbabbbaaabbabbaba +abbaaaabbabbbaaabaabbabb +aabbbababaaaababbabbbbab +abaaabaabbbbabababbbaaababbabaaababaabba +bbbabbabaaabbabbabbabbbabaaababbaaaababababbbbabbabbabaaabaaabaaaaaabaaababbaabb +abbbaaabbabaaaaabababbbabababbbbabaabbaa +aabaaaaabaababbbbaaaaaba +aaaaaaabbabaaaababbbbaab +aabaaababbaaabbabaaabaaaaabbaaaababaababbbbbbbbbabaaaaab +bbbbbbbbbbaabababbbbbbbbaabbabbb +abbbbbbaaabbbbbbaaaaabaabbbbababbabbabab +baaababaabbbaaabababbbbb +bababbbabbabaaabbbabababbbbbabbaabbbabbb +baaabbbabaabbabbbbabbaba +ababbbbabbaaaabbbaababbbaaabbbbbbbabbbabaabaabaabbaabbaabbbaabbaaabaabba +bababbbaababbabbaabaabaabbbbaaab +aaabaabaaabaabbabbaabbaaabbbaaab +abaaababbbbbbaabbaabbaab +aaabbabbaaaaaabbaaabaabb +bbbabbabbbbabaabbbabbbabbabbaabbabbaaabb +bbaababaabbaabaaaabbbbba +ababaaaabaabbbaaaaaababb +babaabababaaabaabbbabbbbbbbbbbbbbabaabbbabbbbbaaabbaababbaaabaababbbbaba +ababbabbbaababababbababbbbabaabaababbabbaabbbbaa +baaaabababbaababaaabaaaaaaabbbaabbababbabaaaaaabbaaabbaaaabaaaaababbbbababbabaab +aaabbbbaabbabbbbbababaaabababbbbabaabaabaabbbaaaabbbbaab +aabbbbbbabbaaaabaaabaabb +bbbaabbbaaaaaaabbbaabaabbababbbaabababbaabbaaabb +bbbbaaaababbbabababaaabb +bbaaabbbbababbbababbbaab +bbabbabbaabbbbabaaaabababaababaa +abaaabaaabaaababbaababaa +aabaaabbbaabaaaabbbbbbab +baabaaabbabaabababbbabaa +ababbabbbaabbbbbbabbabaa +abbbbaaabbbabbbbbababaaa +bbbbbbaabababaaaabaababa +aabbaabaabaaaabbbaabbaba +bbbbbbaaaabbaaaaaabbaabaaaaaabbb +aaaabbbbaaaaabaabaaaaaabaaabaabb +abaaababbaaaababaaaaaaaaabaabbabababbaab +babababbabbabaabaabaabbb +babaaaabbbabbabbbaababab +aaabbababbbbbbbaabbbbabbbbbbaabbaaabbabbaaaabababaaabbaaababbaab +abaabbbabaaaabbbabbbababbaaaabbbbabbabaa +aabbbbaababbaababbbaabaa +bbaabababbaababaaaabbbaa +babaababbbbbabaaaabaaabaabbabbbbaaaaaabbbbaababbabaabaaaaabbbaaababbbbbb +baababbbbaaaaaaabbabbaab +aaaabbbaababababbbbbbabb +bbaaaaaaababbbaaaabbabbabbabaaababbbbbbabbbaaaaabbaababbbaababaa +aaaaaaabbbaaabaabbbabaabbbabaababbaaabaabbaababb +babaaaabaabbbbaabaaaaaabbaaaaaba +aabbbaabababbbabbabaaabababbbbbabaababbaaabbaabaaabbaaaabaabbbbbbaaaababbbaabaab +babaaaaaababbbabaabababb +babbabbbabbaababbabbbaab +baabbbabbabbbabbabbbbaaaaaaaaaaaaabaabbaaaababbbabbbaabb +bbbaabbbbababbabbbbaaabb +babaabbbbaabaaabaaabababbbaabbbbbbbabbba +bababbabbaaabbbabbbbbabb +bbabbbabbbabbbbbbbbaaaab +baabaaaaabbaaaabababaaaaaaabbaaa +ababbbaabbabbabbbaabbbba +abbaabbbaaaabbbbaaaaabba +bbaababbbbababaaabbaababbabbabaababbbbab +bbbabbbbaaaaaabbbbaabaaababaaabbaaaababb +baaaaaabbbbbbabbbbaabbaaababbbbb +abbbbbbbababbaaaababaabababbabbaabaaabaababaaaaaabababab +ababababbbaaaaaabababbbbabaaabbb +baaabbabbbabbbbbbbaaaaabaabababa +baaababaabbaaaaaabababaababbaababaaaabbbbbbbbaaaabaabbaa +abbbbbbaababbaabbababaaaaabbbbbaaababbbbaaabbbbb +aaababaaabaaabaaabaaabbb +baabaaaabbbbbbaabbaabbba +ababbbabbbbbabbababbabab +bbbababaababbbaaaaaaaaaaaaaabababaababab +aababbbbbabababbbbaaaabb +bbaaaaaabbabaabaababbbba +bbabaabaabbabaabbaabbabb +abbbabaabbbbbbabaaaaabaababaabab +baabbbaabbbababaaaaabbab +babaabababbaabbbabaabbbb +aabaaaaaababbabbabaabbbb \ No newline at end of file diff --git a/comptetive-programming/adventofcode2020/19-12-monster-messages.py b/comptetive-programming/adventofcode2020/19-12-monster-messages.py new file mode 100644 index 0000000..beca56b --- /dev/null +++ b/comptetive-programming/adventofcode2020/19-12-monster-messages.py @@ -0,0 +1,286 @@ +import sys +import copy +import pytest +import random + +# sys.setrecursionlimit(1000) + + +class ImposterLineError(Exception): + pass + + +class Rule: + + @staticmethod + def from_line(line): + # print(line) + num, rule = line.split(":", 1) + + num = int(num) + rule = rule.strip() + + letter = None + variants = None + + if rule.startswith('"'): + assert len(rule) == 3 + letter = rule[1] + + return LetterRule(num, letter) + elif "|" in rule: + variants = [ + [int(v) for v in var.strip().split(" ")] + for var in rule.split("|") + ] + else: + variants = [[int(v) for v in rule.strip().split(" ")]] + + return VariantRule(num, variants) + + +class LetterRule(Rule): + def __init__(self, num, letter): + self.num = num + self.letter = letter + + def __repr__(self): + return "LetterRule(num={}, letter={})".format(self.num, + self.letter) + + def matches(self, message, rules, last_matches=None): + print("Matched LetterRule message={} letter={}".format(message, self.letter)) + is_matches = message.startswith(self.letter) + + # second retval is number of letters + return is_matches, message[1:], [[message[:1]]] + + +class VariantRule(Rule): + + def __init__(self, num, variants): + self.num = num + self.variants = variants + + def __repr__(self): + return "VariantRule(num={},variants={})".format(self.num, + self.variants) + + def matches_variant(self, message, variant, rules, last_matches=None): + # CREATOR! I COULD BE STATIC. + # -- your tiny func + if not last_matches: + last_matches = [] + + curr_message = message + + prev_match = last_matches[-1:] + + print("-- prev_match/variant/num = {}/{}/{}".format(prev_match, variant, self.num)) + + if prev_match and self.num in prev_match[0] and self.num in variant: + print("return0") + return False, "", [] + + print("-- matches_variant last_matches={} /// {}".format(last_matches, last_matches[-1:])) + + left_variant, right_variant = variant, [] + + try: + idx = variant.index(self.num) + left_variant, right_variant = variant[:idx], variant[idx + 1:] + + assert right_variant.count(self.num) == 0, "Multiple rec not allowed! {}".format(variant) + except: + pass + + print("{}/{}".format(left_variant, right_variant)) + + new_matches_full = [] + + if variant == [self.num]: + return False, "", [] + + for v in left_variant: + if not curr_message: + print("return1 - empty message v={}".format(v)) + return False, "", [] + + is_matches, curr_message, new_matches = rules[v].matches(curr_message, rules, last_matches + [left_variant]) + + print("res1 {}/{}/{}".format(is_matches, curr_message, new_matches)) + + if not is_matches: + print("return1 v={} Not matching to curr={}".format(v, curr_message)) + return False, "", [] + + new_matches_full.extend(new_matches) + + curr_message = curr_message[::-1] + + for v in right_variant[::-1]: + if not curr_message: + print("return2") + return False, "", [] + + is_matches, curr_message, new_matches = rules[v].matches(curr_message, rules, last_matches + [right_variant]) + + print("res2 {}/{}/{}".format(is_matches, curr_message, new_matches)) + + if not is_matches: + print("return2") + return False, "", [] + + new_matches_full.extend(new_matches) + + # new_matches_full.remove(self.num) + + return True, curr_message[::-1], last_matches + new_matches_full + + def matches(self, message, rules, last_matches=None): + if not last_matches: + last_matches = [] + + # Simple circuit breaker + if message == "" and [self.num] in self.variants: + return True, message, last_matches + + should_repeat_rule = False + + rnd0 = int(random.random() * 1000) + + print("{} message={}".format(rnd0, message)) + + for variant in self.variants: + should_repeat_rule = should_repeat_rule or (self.num in variant) + + rnd = int(random.random() * 1000) + + print("{}/{} Prematch variant={} last_matches={}".format(rnd0, rnd, variant, last_matches)) + + is_matches, remaining_part, new_matches = self.matches_variant(message, variant, + rules, last_matches) + + # print("{} is_matches={} var={} {}".format(rnd, is_matches, remaining_part, new_matches)) + print("res0 {}/{}/{}".format(is_matches, remaining_part, new_matches)) + + if is_matches: + print("{}/{} Matched! remaining_part={} {}".format(rnd0, rnd, remaining_part, new_matches)) + if remaining_part and should_repeat_rule: + print("{}/{} Repeating rule {}".format(rnd0, rnd, self)) + return self.matches(remaining_part, rules, last_matches + new_matches) + + return is_matches, remaining_part, last_matches + new_matches + + print("{} False".format(rnd0)) + + return False, "", [] + + +def monster_messages(data): + data_it = iter(data) + + rules = {} + + for line in data_it: + line = line.strip() + + if not line: + break + + rule = Rule.from_line(line) + + rules[rule.num] = rule + # print(rules) + + main_rule = rules[0] + + matches = 0 + + for line in data_it: + line = line.strip() + + is_matches, remaining_part, new_matches = main_rule.matches(line, rules) + + print("{}/{}".format(is_matches, remaining_part)) + + if is_matches and not remaining_part: + matches += 1 + + return matches + + +BASE_TEST = """0: 4 1 5 +1: 2 3 | 3 2 +2: 4 4 | 5 5 +3: 4 5 | 5 4 +4: "a" +5: "b" + +ababbb +bababa +abbbab +aaabbb +aaaabbb""".splitlines() + +MY_TEST = """0: 1 2 | 2 1 +1: "a" +2: "b" + +ab +ba +aa +bb""".splitlines() + +MY_TEST2 = """0: 2 2 +2: 3 3 | 4 +3: "a" +4: "b" + +aab""".splitlines() + +CYCLE_TEST = """0: 0 | 1 +1: "a" + +aaa""".splitlines() + +SIMPLE_REPEAT = """0: 1 1 | 2 +1: "a" +2: "c" + +aa""".splitlines() + +CYCLE_TEST_2 = """0: 0 2 | 1 +1: "a" +2: "b" + +ab""".splitlines() + +CYCLE_TEST_3 = """0: 0 2 | 1 +1: "a" +2: "b" + +ab""".splitlines() + + +@pytest.mark.parametrize("data,expected", [ + pytest.param(BASE_TEST, 2, id="base"), + pytest.param(MY_TEST, 2, id="my"), + pytest.param(MY_TEST2, 1, id="my2"), + pytest.param(CYCLE_TEST, 1, id="cycle"), + pytest.param(CYCLE_TEST_2, 1, id="cycle2"), + pytest.param(CYCLE_TEST_3, 1, id="cycle3"), + pytest.param(SIMPLE_REPEAT, 1, id="simple_repeat") + +] +) +def test_monster_messages(data, expected): + print("\n".join(data)) + assert monster_messages(data) == expected + + +if __name__ == "__main__": + # 190 + # That's the right answer! You are one gold star closer to saving your vacation. [Continue to Part Two] + num = monster_messages(sys.stdin) + print("{0}".format(num)) diff --git a/comptetive-programming/adventofcode2020/19-12.txt b/comptetive-programming/adventofcode2020/19-12.txt new file mode 100644 index 0000000..63f0843 --- /dev/null +++ b/comptetive-programming/adventofcode2020/19-12.txt @@ -0,0 +1,501 @@ +62: 110 112 | 92 68 +85: 38 92 | 102 110 +63: 92 6 | 110 23 +82: 110 | 92 +99: 110 122 | 92 54 +33: 110 61 | 92 103 +24: 110 92 | 110 110 +76: 3 92 +109: 26 92 | 81 110 +94: 92 78 | 110 28 +17: 110 115 +61: 92 110 | 110 82 +25: 9 110 | 61 92 +114: 47 110 | 63 92 +21: 30 82 +103: 82 82 +69: 5 110 | 43 92 +73: 110 116 | 92 69 +52: 92 81 | 110 103 +22: 119 92 | 50 110 +108: 37 92 | 35 110 +2: 71 92 | 20 110 +119: 103 110 | 88 92 +102: 101 92 | 49 110 +92: "b" +91: 92 54 | 110 3 +64: 92 115 | 110 24 +68: 92 30 | 110 81 +89: 115 110 | 26 92 +80: 61 110 | 81 92 +19: 110 73 | 92 1 +16: 115 92 | 103 110 +15: 123 110 | 58 92 +115: 110 110 | 92 110 +70: 92 30 | 110 9 +40: 110 96 | 92 99 +50: 88 110 | 115 92 +18: 26 92 | 48 110 +81: 92 110 +107: 110 30 | 92 115 +38: 84 110 | 12 92 +44: 40 92 | 66 110 +27: 125 92 | 2 110 +41: 92 128 | 110 118 +56: 81 92 | 30 110 +88: 110 92 +13: 75 92 +55: 75 110 | 26 92 +12: 13 92 | 52 110 +28: 122 92 +121: 75 92 | 24 110 +113: 92 81 | 110 54 +98: 103 110 | 3 92 +6: 92 62 | 110 126 +96: 75 92 | 9 110 +9: 82 92 | 92 110 +0: 8 11 +32: 104 92 | 91 110 +116: 110 32 | 92 67 +104: 92 81 | 110 30 +5: 110 109 | 92 105 +117: 110 22 | 92 59 +128: 92 24 | 110 9 +66: 92 98 | 110 21 +46: 76 92 | 89 110 +36: 92 90 | 110 127 +20: 110 115 | 92 3 +4: 48 110 | 30 92 +26: 92 82 | 110 110 +39: 30 110 | 115 92 +127: 61 110 | 9 92 +84: 110 104 | 92 78 +100: 97 92 | 68 110 +106: 110 7 | 92 18 +123: 110 64 | 92 68 +111: 110 74 | 92 46 +42: 114 110 | 19 92 +58: 28 92 | 16 110 +47: 110 15 | 92 124 +54: 92 92 | 110 92 +51: 110 117 | 92 111 +130: 92 41 | 110 106 +30: 92 92 | 110 110 +72: 17 110 | 109 92 +129: 130 92 | 108 110 +14: 85 110 | 51 92 +53: 87 92 | 44 110 +112: 92 30 | 110 122 +45: 61 82 +105: 75 92 | 61 110 +90: 110 122 | 92 9 +122: 110 92 | 92 110 +83: 110 33 | 92 56 +118: 110 61 | 92 75 +74: 120 92 | 78 110 +29: 110 65 | 92 60 +31: 14 92 | 10 110 +110: "a" +87: 36 110 | 94 92 +57: 92 48 | 110 81 +78: 92 115 | 110 54 +97: 92 48 | 110 122 +1: 110 27 | 92 34 +95: 92 107 | 110 86 +79: 110 55 | 92 77 +37: 92 109 | 110 25 +126: 4 110 | 39 92 +101: 45 92 | 80 110 +59: 110 70 | 92 105 +7: 61 92 | 48 110 +48: 92 92 +35: 104 92 | 57 110 +120: 48 92 | 48 110 +34: 29 110 | 79 92 +93: 54 92 | 26 110 +71: 115 110 | 61 92 +125: 121 110 | 45 92 +60: 122 92 | 54 110 +86: 54 110 | 9 92 +49: 97 110 | 91 92 +3: 110 110 +23: 110 95 | 92 72 +65: 92 103 | 110 115 +10: 129 110 | 53 92 +8: 42 +11: 42 31 +77: 103 92 | 81 110 +67: 93 92 | 112 110 +75: 92 110 | 92 92 +124: 83 110 | 100 92 +43: 92 113 | 110 56 + +abbabbbbaaabbbbabbbababaaabaabaabbaabbba +babaaaabbaaabbbbbbbbbaba +bbbbaaaabaaabbabaababbbabaaaaaababaabaaaaabbabbb +baabbbbbbbaababaababbbabbababbbbaaaabbbbbabaabbabaaababb +aabbaabbbbbaabbbbaaabaab +bbaaabbaaaabababbbbaabaa +abbbbbababbaabaabaaaabbbaaaabaab +abaabbbbabaaabaabbbbaabbabaabaaabbaaabbbabbaabbbaabbbabb +baabbbbbaabbaaabbabbabaa +babbabbbabaabaaaaabbababaaaabaaaabbababbabababbaaababaaa +aaababaabababbbbabaaaaab +bbabaabaabbaabaabbbbbbab +bbbbaaaabaaabbabbbbbbaababaabbaabaabbaab +aaabbabbbabababbaabbabba +abbbbbbabbababbbbabbabbabbabaabbaaabbaab +bbbbabaaabbaabbabaaabbbababababbabaabbaabbabbbaa +aabaaaaabaabaaabaaabbaababbbaaababbbbbbabbbbabababbbabbaabaaabaa +baaaababbaaaaaabaabbbabbaaabaaab +abbabbbaaabaaabbaaaaabbb +ababaaaababaaaaaaababbaa +babbabbabbababababbaaabb +bbabbaabaaabbabbababaaababababaaaaababaabbaababb +bbababbbbbabaaabaaabaaaa +abbaaabaaaabaabbbbbaaaba +aaaabababbbbabaabaabaaabbabbabbabaaababaaabaabbaabaaabbabbaaaabababbbaab +aabaababaaaaaabbaabaaabbbabbbaaabaabaaaaabbaaaba +bababaaaabbaabbbaaaabbab +abababaabbbbbaababbaaaabbabaabbbabbbbaaaabaaabbbabbbbaba +ababababababbbaaababbbba +ababbabbabaabbbaabaaaabbaaaaaaaaaaabaaaabbbababb +aaabbabbbaaabaaaabaabaaa +abbbbabbabbbbaaabbbbabbbbabaaaababbbabaababbaabbabaaabba +bbbababaaaaabaaabaabaaabbaababba +aaaabbbbbbabababbbaaabab +aabaababbbbbaabaabaaabaaabababbbbababbabbbbabbaa +babbabbaabababaaabbbabaa +baaaaaaabbabababbbaabaaa +aaababaaaaabaaaaabaaabbaabaaaaab +abaaabaabaaabaabaaabaaaabbaabaaabbbbbbab +aaabbbabaababbbbbaabaaba +bababbbaabababaabababaab +bababbbaaaabaaaabbbaaabbabbaaabb +ababaaabbababaaabbabbbbabaabaabaabaababb +bbabbaabbabaabbbabbabbbaaabbaabaaaaaaaababbbbaaaabbaabab +aaababababaaaabbaaaaabba +babaababbbbabababaabaaaaababbabaabaaabba +aaaabaaaabababaaaaabbaaa +aabaaaaababbbaaaabbbabababbabbaa +bbbbaababaabbbabbbbabbaa +baaaaaabaabaaaaaabbaabbaabbabbbbbbbabbabbbbbabbbabaabbab +ababababbaaaaaabaabaabbb +abbbababababbbaababbaabb +aabbaaabaabbaabbaaaaaabbbbaaabbaabbbaaaa +bbabbbbaaababaababbbbbbaabbbbbabbabbabbb +babbbabaabaabbbabaabbaab +bbabbbabababbbabaababbbaaabaaaababbbbaba +babbaaaabbbabbbbabbaaaba +bbbbababbbababbbbbabbbabbbaabbbbaaabbaaa +ababbbaababbbabaaaaaaabaabaaaaaabbabaabbaaaaaabababaaabaaaaaababbbbabbbbaababbaabbbbaaab +aabbbabbaabbaabbbaaabababaaabaabbbabbaba +bbbabaabbbabbaabbaabaaaababbababababbbba +abaabbbabaaaaabbabaaabbb +bababbabaabaabaaaabbbbaabbababba +aabbaaabaabbbabbaababaaa +baababbbbbabaabaaaaabbab +bbbbabbaabbbbbbbabbbaaaaaaabaabababaaaaaabababbbbaababab +baaaabbabbaaaaaababaaaaaabaabbbbababbbbb +baababbbabbbbaaabbaabaaa +bbbabbabbbbbabbbbaaaaaaaaaabbabaabaababb +bbbbbbaabaabbbaaabbbaaba +bbbababaaabbbbbbbbbbababaabaabaababbbbba +abbaabbaabbaaaababaaaaababaabaaaaabbbaabaabaaaabaabbabbbbabaabba +baaaabbbaaabbaabaabbbabababbaaab +abaaabaaabababaababbbbbb +bbbbaaaabbabaabaabaaabaabaabbaaa +bbaaabbbbaaaaaaabaabbbbbbbbaabbbaaaaabbb +abbaabbabaaabbabaaabbbbabbababba +baabaaaaaabbabaaaabaabbbbaabbaab +babbbababaaababaabaabbaa +aabbbbaaababbbaaabaaaaab +bbaaabbbaabaaabaabbbabba +babbbaaabababaaababbbaab +aaaaaaaaabbbababaaabbaab +bbaabaabbabbbaaababbbaaabbbbbaabbbababba +ababababbaaabbabbababbbbbbbbabba +abbaabbababbbabaabbabbbabbaaaaababbbabababaabbaa +aabbbabaaaabbbbbababbbbbbabbaaabbabaababaabbabab +babbbaaababaabbbbbbabbaa +ababaabaaabbaaababaabbbb +aabaabaaaabbbbaaaabbabaa +baaaabbbbbbababbaabaababaabbabaaababbbbabaaabbbbbbbaaabbabbbbbbaaaaaaabaaaaaabbbbbbaaaba +baaabbabbabbbabaaaabaaba +baaaabbbbbbbbaababbbbbbb +baaaabbaaabbbbbbaababaaa +aabaababbaaaababaabbabba +aabbbbaaaabbaaaabaababba +bbaaabaaaaaabbbabbabaabababbabbaaababbababaabbab +abbabbbaaabaaabbabbabbaa +aaaaabbbbbbbbbbbabaababbababbbbabbbabbbaabaababb +bbbbababbbabaabababbbabaaabaabababaaaabbabaabbabbbaabbab +babbbabbbababbbbabbaabbbabaaaabbbbabbaabaabbabaaabbbbaab +baabaabbaaababbaaababbbbbbaaabbbabaaaaabbbbbaaabbbbaaaaa +abaaababaaaabababbaabbab +abababaaaaaabaaababbabba +abbbaaabbaabbbbbbaaababb +baabbbbbbbbbabbbbbaabbba +abaaabaaabbbbbabbbbabbba +babbbabbaabaabaaabaaaaaa +aaabbabbabaaababbbbabbabbabaaaabaabbababbbbbabba +aabaaaaaababaaaabababaaaabbbbbbababbaabaabbbaaaa +abaaaabbbbbabaaaaabbbbababaabaaa +aaabbbabaaaabaaaabbabbab +bbbbaabbbabbbabbbaaabbbabaabaabbbabbabbbabaaabbaabbababb +babaabbbbbbbababbbaabaababbaaabb +abbbbabbbbbbbbbababbaabb +abaaaabbaabbbbaabaabbbbbbabbabbababbbbbbabbabbaabababaab +aaabbabbaaaabbbaabbbabaa +babbbabaabababaaababbaba +abbaabbababaaaaaaababaaa +aabbbabbabababbbabbbbbaa +aababbbbbaaaaabbbaabbaab +aabbaabaaabaabaaaabbbaab +abaabbbabababaaaaabababb +abbbbbbaabaaabaababbabbb +baabaaaaaaabbabaaabbaabbaabbaaab +baababbaababbaabbbbabbaa +ababababbabaaaabbaaabaab +abbabbbbabbbababaabababb +bbabbabbbbabaaabaabbbbba +aaaaaabbbaaaaabbabbababb +baaabaaababbbabaaababbbbbbaabbab +bbbbbbbababaababaababbaa +baaaaaaaabaabbbaababbabbbaaaaaabbaabaaaaababbbbaaabaabaa +aaabbbabbaaaabbbbabbbabababaaabababaabba +bbbabbabababbabbbabaaabb +bbaaabaaaaaaaaaababaaabb +aabaabbaaabbbaabbaaabaaaababbaab +abbbbaaabbabbbbbbbbbbbaabbabbabbbabbbbab +aaababaabaababaabbbaabab +baabaabbbbabbbabababbaaa +abbbaaabaabaababbbbbababababbaabbabaaaaaabbbbbaa +aabbbbbbbbbabbbbabaabaab +bababaaabbbabbbbababbaba +bbabaabbbababaaabaaaaabb +bbbbbbaababaababababbbbb +bababbbbabbbbbabbaabaaba +aabaababbbbbbbbabaabbbabbbabbbabbbabbaabaabaaabbababbaba +ababbbabbaaabbabababbbbbababaabaaabaabaabbbaaaaaaaaabbaabbbababbaaabbabbbbaabbaa +bbabbbabaaabbabaabaabaaa +bbabbaabbbaaaaabababbbbb +bbbbbbaaababbabbaababbaa +bbbbbbaabbabababaaaabaab +abbaaabbabbababbabababbaaabbbbababbaabbbabbbbbab +bbbbababbabbbabbbbaabaaa +bbaabaabbababbaaaabbaaaabaaaaaba +abbaabaaababbabbabbbabaaaaaabaab +baaaababbbabbabbbbbbaabbabbaaaaabaabbbaaaaabbaaaabaaaaab +bbbbbbbabaabaaabbbabbbbaaabbbbababbaaabb +bbaaabaaabbaaaaaaaabbaaa +babaabbbabbabbbbbaaabbbbababaabb +bbbbabbbbababbbabbabbbaa +baaaaaababbaaaabbbbaabba +abbbaaabbbbbababaabbbbbb +aabbaaaaaababaabbabaabbbbabbaabaaaaaaaaaaababbab +aaabbabbbbbabababbbbbbab +babaabaabbbabaaaaaabbababaababba +abaabbbaabbbbbababaaaaab +aaabbabbaabababbaabbbbba +aabaaabaaaaabbbaabbbaabaababbbbbbbbbaabbbbbbaabbbaabbaaa +abbaabbbbaaaabbbabbbaabb +bbaaabbaaaababaabbbabaababaaaabaaabbbaabbbaababbbaababba +babaababbabaaaaaaaaaabaabbbbbaababbabbaa +bbaaabbabbabbbabaaaaabbb +aaaabababbababbbaabbbbababbaaaaabaaaaaba +bbabaabbbbbbbbbaabaaaaab +bbabaaababaaababbaaaabaa +aabbaaabaabbbabaabbbabaa +bababaaabbbbbbbabababaaaabaaaaab +abaaaabbaaaaababaaaaaaba +baaaabbaaaababababaabaabbaaaaabbbaababba +bbababbbbbaaaaabaabababb +bbbabbbbbbbbaababbbbaabaabbbbbaa +bbbabbbbabaabaaaababbbbaababaabb +bbbbababbabbbabbbabbabaa +baaabababaabbbaabbabaabababbabbaabbaabab +aaababbabaaaaaaabbbaaaba +baaaaaabaabaaabaaabaabba +babbaabababababbaaabbaaa +bbbababaaaaaaaabbbbaaaab +bababbaabbbabaabbaaaaaba +abababbbbbbbabababbabbaa +aaabbbabbaaabbabaabababa +aaaabbbababaabbbabbaaaaaabaababbbabbabab +bbaaaaababaaabaababaaaabbabaabbbaaaabbaa +abbabaabaabbaaabbababbbabaaabaab +abbbababaaabbabbaaabbaab +abbabbbbabaaababaaabbbaa +aababaababbaabbbaababbaa +babaabaaaaabaaabbbbbaaab +aababbbbbaababbbbaabbabb +bbbbaaaaabaaaaabbbbaabaabbababbabaaabbaabbbaabab +ababababbaaaabbbbbbaabbbabbbbbaa +bbabbbbbbbababbbbabbabab +bbbbbbbbbbabbaabbabbbaaaaabbbabaaabbbbba +bbabbbabaabbaaabbbbabbba +aabaabbbbbaababbaabababa +bbaabaabbbbbababbbbbbaaa +bababbaaaaaaaabbabbbbaaabbbabaababbbbababbabbbaaabbbaabb +aabbbbbbbbbbabaabbbbbaaa +ababbbaabbbaabbbbaaaaaabababaaababbbababbbabababbbaabbbb +aabbbbbbbaabbbabbbabbaaa +bababbababaaaabbabaabbab +aababbbbababababaaabbaaa +bbbbababbbabbbabbaababaa +abbbbaaabbaaabbbbaaaaabbaaaaabba +abbaabbabbaabaabbabbaabb +baaaabbbaaabbbbabaaabaab +baaabaaabbaababaaaabbaab +baabbbabbbbbbaabbabaabbbbaababab +bbabababaaabbbababaababa +aabaabaabbabbbbababbaaababbbabbbaabbabaabbbbabbabbbbbbbb +abaaaababbbbababaabababb +abbabbbbaaaabbbbabbabbbbababaabb +aababaabaaaaabaababaaaba +abbbbaaabbaaaaabaaabbaaa +aabaaabaaabbaaaaaaaabaab +bbaaabbbbbbababaaabababa +bbbabbabbaaaababbabaabbbaabbbbbbabbaaaaabbababba +bbbbababbaaaaabbabbbbbabbaabbabb +bbabaabbbbbbaabbbaabbbabaabaaaaabaabbaaa +abbaaaabbbbbabbbabaabaaa +aaabbbbaaaababbabaaaaaba +bababbaabaaaabbaaaabbaaa +ababababaaaabaaaababbaab +aabaaababbabaabaabaabbbb +abbaabbbbbbbabbbbbbbbaabbbababbbaaabbaaabbababaa +abbabbbbaaaabaaababbbabaabbbabaaaabbabaa +aababbbbbaabaabbbbbabaabaababbbbbbbbaaabbbabbaaa +babaaaabbbabbaabbaababba +bbabbbabbbbbabaabaaaabaa +aaaaaabbaabbbababaaabaab +abaaaababbbbbbaaabaabaab +abaabbbabaaaaabaaaaabbaaaaaababbabbbaabb +bbbbaaaaabbaabbabbbbabbbbbabaabaaaabaaab +bbabaaabaababbbabbababbbababbaaa +bbbbbbbbbbabaaabbaabbabb +bbbabbbbabbaabbbbaababbbabbababb +bbaaabbabaabbbaabaababab +bbabaabaabbbababbaaabbabbbbbaaab +abbbbaaaababababbabaabbbabbbbbbb +babaaaaaaabaaabababaababbabbaabbbbaabaaa +baaaabbabbaababaabbababb +aaaaaaabbaaaabbbbbbaaaaa +aabaaaaabbbabaabbaababaa +abbabaabbbabbbbbbaabaaaaaaaabbaaaaabbaab +baaaabababbbbaaabaababaa +babaaaaabaaabbbbaaabaaaa +aaabbababaaaaaaaabbbabaa +bbabaaabbaaaababaaabaaaa +bbaaabbbbabbbbbaaabbbbbaaabbbbbabbabaabababbbbbaabbabbaabbbabbbaaaaaaaababbbbababaabaabb +aabaaaaaaabababababbabaaaaabbaaa +bbbabaaabbaaaaaabbbaaaab +abaaaaaabbabaaaabbbaabbabbababaa +bbaaabbaaabbbabaababbbbb +bbabaaabbababbbababaaaabbabaaaba +abbabbbabaaabbbaaabaaaab +baaabbbbbabbbaaabbbaaabb +bbaaabbaababbbababaaabba +aaaaabaaaabbbbabaabbbbaaaababbbbbabaabbbbbabbbaa +bbaaaaaaabababbbbabbbbaa +ababbabbaabaaaaaaaababbb +babbabbabaabaaabbabaababbbbaabbbbbababababaababb +abbaaaaabababbbbaaaabababbaaaaabaabaabbb +bbaaabbbbaaaabbbaaabbaaa +bbabaaabbaaaaaaabbabbaba +bbabaabaaabaaabbbaaabababaaaabaa +bbbbababbbbabaaababbbaaaababababbaabbbaaabaabbaaaaabbbbb +bbaaaaabbbaaabaabaababab +aaaabaaabaaabbbaaababbab +aabbaababbabbbbbabbababa +baaaaaaaaabbaabaaabbbbabbaaaaaababaababb +aabbaaabababababaaaaabbb +aabaaaaabbbbaabaaaaabaab +bbaaaaabbbbabaaaabbbabba +babaaaababbabbbbbbbaaaaa +bbbbaabaaaabbbbababbaabaabbbababaabaaaabbaababba +bababbbbbabbbaaabbabbaba +abbaaaabbabbbaaabaabbabb +aabbbababaaaababbabbbbab +abaaabaabbbbabababbbaaababbabaaababaabba +bbbabbabaaabbabbabbabbbabaaababbaaaababababbbbabbabbabaaabaaabaaaaaabaaababbaabb +abbbaaabbabaaaaabababbbabababbbbabaabbaa +aabaaaaabaababbbbaaaaaba +aaaaaaabbabaaaababbbbaab +aabaaababbaaabbabaaabaaaaabbaaaababaababbbbbbbbbabaaaaab +bbbbbbbbbbaabababbbbbbbbaabbabbb +abbbbbbaaabbbbbbaaaaabaabbbbababbabbabab +baaababaabbbaaabababbbbb +bababbbabbabaaabbbabababbbbbabbaabbbabbb +baaabbbabaabbabbbbabbaba +ababbbbabbaaaabbbaababbbaaabbbbbbbabbbabaabaabaabbaabbaabbbaabbaaabaabba +bababbbaababbabbaabaabaabbbbaaab +aaabaabaaabaabbabbaabbaaabbbaaab +abaaababbbbbbaabbaabbaab +aaabbabbaaaaaabbaaabaabb +bbbabbabbbbabaabbbabbbabbabbaabbabbaaabb +bbaababaabbaabaaaabbbbba +ababaaaabaabbbaaaaaababb +babaabababaaabaabbbabbbbbbbbbbbbbabaabbbabbbbbaaabbaababbaaabaababbbbaba +ababbabbbaababababbababbbbabaabaababbabbaabbbbaa +baaaabababbaababaaabaaaaaaabbbaabbababbabaaaaaabbaaabbaaaabaaaaababbbbababbabaab +aaabbbbaabbabbbbbababaaabababbbbabaabaabaabbbaaaabbbbaab +aabbbbbbabbaaaabaaabaabb +bbbaabbbaaaaaaabbbaabaabbababbbaabababbaabbaaabb +bbbbaaaababbbabababaaabb +bbaaabbbbababbbababbbaab +bbabbabbaabbbbabaaaabababaababaa +abaaabaaabaaababbaababaa +aabaaabbbaabaaaabbbbbbab +baabaaabbabaabababbbabaa +ababbabbbaabbbbbbabbabaa +abbbbaaabbbabbbbbababaaa +bbbbbbaabababaaaabaababa +aabbaabaabaaaabbbaabbaba +bbbbbbaaaabbaaaaaabbaabaaaaaabbb +aaaabbbbaaaaabaabaaaaaabaaabaabb +abaaababbaaaababaaaaaaaaabaabbabababbaab +babababbabbabaabaabaabbb +babaaaabbbabbabbbaababab +aaabbababbbbbbbaabbbbabbbbbbaabbaaabbabbaaaabababaaabbaaababbaab +abaabbbabaaaabbbabbbababbaaaabbbbabbabaa +aabbbbaababbaababbbaabaa +bbaabababbaababaaaabbbaa +babaababbbbbabaaaabaaabaabbabbbbaaaaaabbbbaababbabaabaaaaabbbaaababbbbbb +baababbbbaaaaaaabbabbaab +aaaabbbaababababbbbbbabb +bbaaaaaaababbbaaaabbabbabbabaaababbbbbbabbbaaaaabbaababbbaababaa +aaaaaaabbbaaabaabbbabaabbbabaababbaaabaabbaababb +babaaaabaabbbbaabaaaaaabbaaaaaba +aabbbaabababbbabbabaaabababbbbbabaababbaaabbaabaaabbaaaabaabbbbbbaaaababbbaabaab +babaaaaaababbbabaabababb +babbabbbabbaababbabbbaab +baabbbabbabbbabbabbbbaaaaaaaaaaaaabaabbaaaababbbabbbaabb +bbbaabbbbababbabbbbaaabb +babaabbbbaabaaabaaabababbbaabbbbbbbabbba +bababbabbaaabbbabbbbbabb +bbabbbabbbabbbbbbbbaaaab +baabaaaaabbaaaabababaaaaaaabbaaa +ababbbaabbabbabbbaabbbba +abbaabbbaaaabbbbaaaaabba +bbaababbbbababaaabbaababbabbabaababbbbab +bbbabbbbaaaaaabbbbaabaaababaaabbaaaababb +baaaaaabbbbbbabbbbaabbaaababbbbb +abbbbbbbababbaaaababaabababbabbaabaaabaababaaaaaabababab +ababababbbaaaaaabababbbbabaaabbb +baaabbabbbabbbbbbbaaaaabaabababa +baaababaabbaaaaaabababaababbaababaaaabbbbbbbbaaaabaabbaa +abbbbbbaababbaabbababaaaaabbbbbaaababbbbaaabbbbb +aaababaaabaaabaaabaaabbb +baabaaaabbbbbbaabbaabbba +ababbbabbbbbabbababbabab +bbbababaababbbaaaaaaaaaaaaaabababaababab +aababbbbbabababbbbaaaabb +bbaaaaaabbabaabaababbbba +bbabaabaabbabaabbaabbabb +abbbabaabbbbbbabaaaaabaababaabab +baabbbaabbbababaaaaabbab +babaabababbaabbbabaabbbb +aabaaaaaababbabbabaabbbb \ No newline at end of file diff --git a/comptetive-programming/adventofcode2020/20-12-jurassic-jigsaw.py b/comptetive-programming/adventofcode2020/20-12-jurassic-jigsaw.py new file mode 100644 index 0000000..c4079cb --- /dev/null +++ b/comptetive-programming/adventofcode2020/20-12-jurassic-jigsaw.py @@ -0,0 +1,77 @@ +import re +import sys +import copy +import pytest + +from collections import namedtuple, defaultdict + +Tile = namedtuple("Tile", "num,dirs") + + +def lst_to_int(lst): + return int(str("".join(str(int(l == "#")) for l in lst)), 2) + + +def parse_tile(iter): + match = re.match(r"Tile ([0-9]+):", next(iter)) + + number = int(match.group(1)) + + top_line = list(next(iter).strip()) + left_line = [top_line[0]] + right_line = [top_line[-1]] + + for i in range(0, len(top_line) - 2): + next_line = next(iter).strip() + + left_line.append(next_line[0]) + left_line.append(next_line[-1]) + + bottom_line = list(next(iter).strip()) + left_line.append(bottom_line[0]) + right_line.append(bottom_line[-1]) + + dirs = tuple( + lst_to_int(d) + for d in (top_line, bottom_line, left_line, right_line) + ) + + return Tile(number, dirs) + + +def jurrasic_jigsaw(data): + tiles = defaultdict(set) + + tiles_list = [] + + data_iter = iter(data) + + while True: + tile = parse_tile(data_iter) + + try: + assert next(data_iter).strip() == "" + except StopIteration: + break + + print(tile) + + if not tile: + break + + tiles_list.append(tile) + + for d in tile.dirs: + tiles[d].update(tile) + + for i, tls in sorted(tiles.items(), key=lambda x: x[0]): + print("{}: {}".format(i, tls)) + + # print(dict(tiles)) + + return 0 + + +if __name__ == "__main__": + num = jurrasic_jigsaw(sys.stdin) + print("{0}".format(num)) diff --git a/comptetive-programming/adventofcode2020/20-12.txt b/comptetive-programming/adventofcode2020/20-12.txt new file mode 100644 index 0000000..2b00cba --- /dev/null +++ b/comptetive-programming/adventofcode2020/20-12.txt @@ -0,0 +1,1727 @@ +Tile 3001: +##...#..## +.##...#.## +###....... +#...##..## +...#..#..# +#..#...#.. +#......#.. +....#.##.. +#......#.# +..##.#...# + +Tile 2069: +###..##..# +....##.### +###..##..# +..#..#.#.# +#......... +##.#...#.# +.........# +....#..#.# +#......... +###.#...#. + +Tile 3023: +.##..##... +......##.# +#......#.. +..#....#.. +#.....#.#. +#.....#... +...#...#.. +......#### +....###..# +.#.#.#...# + +Tile 3389: +....#..#.# +##...#.... +.....#.... +.....#..#. +.#...##... +##..#...## +##.##..#.. +#...##.... +.#....#... +..#....... + +Tile 2693: +#.#.###.#. +....#..... +...#.##.#. +.###.....# +.#..#..#.. +#..#....#. +#......... +......#..# +#..#...... +...#.###.. + +Tile 1987: +####.#..#. +##.#.....# +#.#..###.. +.#.#..###. +#.....#... +#..#...... +.....##..# +....##.... +#....#.#.# +.###...#.# + +Tile 2113: +...#.###.# +#.#.##.#.. +.....##..# +#.#..#.... +#........# +#.#.#.###. +#.##.###.. +..#.###..# +......#.## +#..#.#...# + +Tile 1999: +#.####..## +#.##..#... +.#..####.. +.#..#.#... +......#.#. +.......#.. +.#........ +##..#.#..# +......#... +.#####..## + +Tile 1973: +#..#.###.# +.......#.# +#..##....# +..#.#..... +.##.....#. +#....#.#.# +...#.###.# +#......#.# +......#.## +#.#.#...#. + +Tile 1801: +######.#.# +#..###...# +.#.##..#.. +.##..#.#.# +.......... +..#...#.#. +..#......# +##.......# +#....#...# +#..#.#.#.. + +Tile 3881: +#.###...#. +#......#.. +#.....#..# +......#..# +#.......#. +#.#..#..#. +##....##.. +#..#.#...# +#.#......# +.#...#.### + +Tile 1823: +####..#.## +##.......# +.......#.. +....#.#### +.#.#.#..#. +#....#.... +#......... +#..#...... +.####.#..# +#.###.#... + +Tile 1031: +..##.##.#. +#.#....... +#...#....# +.....#.#.# +#.....#... +#.#.#..... +....#....# +#......... +..#....... +##.###.### + +Tile 1361: +.#.####..# +##..#..#.. +.#........ +.##......# +#..#...... +.#.......# +#..#..#... +#..#...... +#........# +#..##.#.#. + +Tile 1483: +.###....## +...#....#. +.......... +#..##....# +#......#.# +#......... +##.#...... +.....#.### +#...#..... +#..#.##..# + +Tile 2381: +.#.#...##. +#...#..... +...#.#...# +...##.##.. +...##..... +..##...... +........## +#..##..##. +..##.#..#. +#####..#.. + +Tile 2447: +.##.##..#. +.#....##.# +.#..#..### +...##....# +#.....###. +......#..# +#.......## +.......#.. +.....#.#.# +.#.####.## + +Tile 2633: +..##.#...# +.........# +#..##..... +.#.#...### +..#....##. +#.#.#...## +#.##.....# +#........# +....#..... +..##..##.# + +Tile 1861: +.###.###.# +.##.#..#.. +##..#..#.# +##..#..#.# +.###..#.#. +.......... +.....#.... +....###.## +.#...#.... +.#.##..##. + +Tile 1453: +#....#...# +#..#.....# +..#..#...# +#.#..#...# +#.#......# +##..##...# +...#...#.. +#..#...### +....#..#.. +#.#.#..... + +Tile 3719: +.#...##### +.##..#.... +.#...#...# +.......#.# +#....#...# +....###... +..#..##... +..#..##... +##......#. +#####.#..# + +Tile 3167: +.......#.. +#........# +.#...#..## +.#.#.#...# +#..#..##.# +#......... +.#....#... +##..#....# +....#....# +#.###..#.# + +Tile 2521: +.#.#.##... +#...#.#.#. +#........# +.......#.. +..#....... +#....#..## +.#..#.#... +#.....##.# +....#.##.# +..#######. + +Tile 1601: +....##.#.# +...##...#. +#..##....# +#.###...#. +#.......## +..#....### +...#..#.## +....#..### +##..#..##. +#......#.. + +Tile 1657: +.##...#... +##.....#.# +##.#.##.#. +#.#...#..# +.......#.# +........#. +#.#......# +##..#..#.# +.#....#..# +..#..##.## + +Tile 3919: +##....#.## +....#..#.# +#..#.....# +#......#.# +#.....#... +#...#...#. +..###....# +#..##..... +..##.#..## +####..#..# + +Tile 3851: +###.#####. +##.......# +#..#.....# +#......### +......#.#. +#.##..##.. +#...#....# +.....##.#. +#...##.#.. +........## + +Tile 3821: +.###.##### +.....#.... +...##....# +##........ +#.#..#.... +#..#..##.. +...#.###.. +#....#.... +#...#....# +..#..###.. + +Tile 3499: +#######..# +#...##...# +##...#...# +......##.# +#.##...... +#......... +...#..#..# +.....#.#.. +....##.... +.###...#.# + +Tile 3191: +##.#.#..#. +....##.... +...#...#.# +...##..#.. +#..##..... +#...#.#..# +.#.#...#.. +#####...#. +##.....##. +..###....# + +Tile 3137: +.#...#.... +##........ +#..#...#.. +#..#..#... +..#...#... +.##......# +..#..###.. +#.#..###.. +#..#.#.... +.#......## + +Tile 2551: +#.#####.## +..#.#..#.. +#......... +#..#.##.## +...###.##. +..####..## +#.#..#...# +#.....#... +#.#......# +#.##.#.### + +Tile 3217: +#.####...# +.........# +..#......# +##.#..#.## +#..##..#.. +.#.#....## +#.#......# +.........# +.#.##.#..# +....##.#.# + +Tile 3491: +###.###..# +.#........ +..#....#.. +...#..#..# +##.#....#. +#....#.... +#.....#... +.##......# +.#.......# +#....#.##. + +Tile 3181: +#.#.#####. +##.#.....# +#..#.#..#. +##..#..#.. +#..#....#. +........#. +#...##..## +#.##.##..# +.#.#.#...# +#.#.###.#. + +Tile 2819: +..#.#.#.#. +.....#.#.. +..#.#..#.. +#..#.#.#.# +#.#.#..##. +##.....##. +##......## +##.###.#.. +...#...#.# +..#.#..#.# + +Tile 2857: +###.#....# +####.....# +#....#..#. +#....##... +...#.##... +#....#...# +.#...#...# +##.......# +#..####.#. +...###.### + +Tile 1783: +#..##....# +#.....##.# +#......### +....###### +...####.## +#.......#. +...#.....# +.......... +#........# +.#.##.##.. + +Tile 2297: +.###.####. +.....##.## +...#...#.. +##........ +.......##. +##.#.#.##. +##.#.#..#. +##........ +...#.##..# +.###...### + +Tile 3727: +...#..#.#. +###.##.#.. +#.##..#.#. +.#......#. +##........ +.#....#### +#...#..#.# +########.# +....#####. +####.#.#.# + +Tile 2237: +.####.##.. +#....##... +.......#.. +#......#.. +...#...#.. +.........# +#....#.#.. +#...#.#... +.........# +#####..... + +Tile 2281: +####..###. +#...#.#..# +#........# +#.#.#.##.# +#........# +.###.#.... +#.....#... +...##..#.. +##......## +###.....#. + +Tile 1321: +.....##..# +.#.#...... +#..#....## +....##.... +#...#...#. +#.....#..# +..#.....## +..#....... +.##...#... +.#.###.... + +Tile 1489: +##..#..... +.......... +#........# +###......# +###......# +#....#.... +.......... +...#..#..# +....#....# +#.#.#....# + +Tile 2251: +#..#...#.. +##..#....# +........#. +##.......# +##..#.#... +#..#.#...# +....##...# +....###.#. +#...#..##. +#..##.###. + +Tile 3467: +#.##...#.# +#...#..... +#.#....##. +###....#.. +#..#####.. +...#...... +...#...... +.#.#.....# +#..#.....# +.#.######. + +Tile 2677: +.#....##.# +#.#.#..... +#.#....#.# +.......#.# +###.#....# +#..##..... +#.###..... +#..###.... +.......... +#.#.#...## + +Tile 3457: +.#.#.#.### +#..#..#... +###......# +#...#....# +#.#...#### +#.......## +...#.##... +#......#.# +#...#..... +.###.....# + +Tile 3307: +#....#.### +#....##.#. +..#.###... +##.##....# +...#...... +....#.#..# +..#.....## +.....#.#.. +#...#..##. +#.#...#.#. + +Tile 3187: +.###.#.#.# +..#..#...# +#.....#..# +#.......## +...#.#..#. +#........# +.#.....#.. +.#...#.#.# +#.....#..# +......#### + +Tile 2357: +.#...##..# +..#.#...## +......#..# +.#....#..# +#.....#### +##.....##. +#.###..... +#......#.# +...##.#... +.#....###. + +Tile 3529: +.##...###. +.......#.. +.......#.# +.........# +##..#...#. +##..#..#.# +#....##.## +.........# +#........# +###....#.# + +Tile 1069: +...##..... +##.#...#.. +#..#.#...# +..#..#.#.. +##.#..##.# +#.#..#.##. +#..#.....# +#..#.#.... +.........# +.###..##.. + +Tile 2393: +.#.#.....# +.......### +.......... +..##...#.. +.....#.... +.........# +#.##.....# +...##..#.. +..#...#..# +####..#... + +Tile 2389: +.#####...# +#........# +#.#....... +.#........ +........#. +#......... +.....#.#.# +...###...# +#.......#. +#####.#### + +Tile 3673: +#######..# +#..#..##.. +....#...#. +#....#.... +...#..#.#. +#.#..##... +....###..# +#.....#..# +#........# +.##..###.. + +Tile 1907: +.###...... +#.....##.. +#.#...#... +#....##### +.....#..## +#.#......# +#....##... +#.....##.# +##.#.##... +....###.## + +Tile 2963: +.#.######. +......#... +#.....##.. +.#.......# +.....#.... +.#...#...# +#.#......# +###....... +###....##. +#..##.##.. + +Tile 3583: +.....##... +#.....#.## +##.......# +.#.......# +#........# +#....#.... +.#.##....# +#.......## +#..####... +#....###.. + +Tile 3251: +.####.#... +###.#....# +....#.#### +#.#...#### +.#........ +##.#.....# +..##..#... +.#...#.#.# +..#.....#. +#.###.##.. + +Tile 2939: +.###...#.. +.......#.. +#...##.#.# +.#.....### +.#.##..... +#......#.# +#..####.## +##.##....# +....##...# +#.##.##.## + +Tile 2557: +..##.#.#.. +#.#..#...# +..#......# +..#...#... +#.#...#.#. +#........# +##....#### +#.#..#..#. +#......... +.#.###.##. + +Tile 2753: +.#.##....# +#......#.# +#........# +#.....#..# +.....#...# +.........# +.##.#..... +....#.#..# +........## +.##..####. + +Tile 2971: +...#.##..# +#..#....## +.#.##..... +.......... +........## +#..##..... +..##.....# +...#.#...# +#....#.... +...#.#.#.. + +Tile 2539: +#....#..#. +..###..... +###.#....# +........## +#..#..#... +..#.##.#.# +#..##...## +####...... +#.#....##. +###.#.##.# + +Tile 1913: +##..#....# +#....#..## +#..##...## +#...##...# +##..#..... +##..#..... +....##...# +#..##..... +#..#..#### +#..##..##. + +Tile 2153: +...#...... +#.#.....#. +#......... +.#........ +..#......# +..##.#..#. +#.#..##.#. +##....##.. +..#....#.# +.###...#.. + +Tile 1559: +..#...##.. +...#....## +#....#..#. +##.##..#.# +..#..#.#.. +#.#.#..... +..#......# +##........ +.#.......# +.....##..# + +Tile 2999: +#...#..##. +##....#... +#....#..#. +....#...## +#...##..## +....##..## +##.##..... +#...#..#.. +#...#....# +#...#.#..# + +Tile 2039: +#.##.##.#. +.#....#..# +.#.......# +.....#.... +.#..##...# +..#....#.# +###..###.# +##...###.. +#....#.... +####....#. + +Tile 2129: +##.######. +#.#..#..## +#.###..... +#.....#.## +....#..### +..#......# +......#... +..#....... +##......#. +....####.# + +Tile 3407: +#..##.#..# +#.#...#... +#....#...# +#...#.#..# +#...#..... +..#...##.# +#..###...# +....#..... +..#.#..... +##....#### + +Tile 1093: +.##..#.### +#.....#.## +.......#.. +.....#.#.. +...#...##. +........## +.##....... +.#......## +..#.....## +....#####. + +Tile 3623: +##..###.## +..#......# +#.#..##.#. +.....#.... +.#........ +.##.#..#.. +#.#..#..#. +#.....#..# +...#..#..# +#.##....#. + +Tile 3931: +.##..#.### +#....#.... +#....##... +..##..###. +........#. +.#.......# +#......#.. +.##.....## +.####..... +##.##.###. + +Tile 3371: +.#...#...# +#.#....#.# +#.#...#... +.....#..#. +###....... +#........# +#.##.#..#. +#......... +#......... +.#####...# + +Tile 1381: +####...#.. +##........ +#.......#. +#.#....#.. +..#......# +.......... +##........ +##........ +.........# +#..##..#.# + +Tile 2011: +.#.#...#.. +#.....##.# +#.....##.. +....#..#.# +##..#...#. +.....#.#.# +#....##..# +....#.#.#. +.......#.. +.#.###..## + +Tile 2341: +###....#.. +#........# +.#...#...# +.........# +#......#.# +......#... +##....#..# +#....#..#. +###..#...# +#.#.##..#. + +Tile 3677: +.#..###.## +...#..#.#. +#..#.##.#. +.##.##..## +......#..# +#.....#..# +....#..... +#..##....# +#..#.#.### +...####.#. + +Tile 1373: +####.#...# +.........# +##.......# +.......... +.........# +#...#...## +#.#..##.## +....#..... +......#... +.#.####.## + +Tile 2591: +..##.....# +..#....... +##.##.#.## +.#####..#. +.....#..## +#..#.....# +........## +..#..#...# +.#....##.# +#..#.####. + +Tile 2707: +.#.#...#.# +......#..# +#...#.#..# +#.#....#.. +#........# +#...#..... +....###..# +#......... +...#.....# +##..#..##. + +Tile 2917: +...####### +.#...#.... +.#........ +.....#...# +..#...#.## +#.......## +#....##... +.##.#..#.. +#.##...... +.#..##...# + +Tile 3229: +..##.###.. +....#..... +......##.# +#.###.#..# +#....###.# +.........# +......#..# +....##.##. +#.#.##.#.# +#.#..##.#. + +Tile 2459: +..###.##.. +#.......## +...#...### +.........# +#..#....## +...##..... +##........ +##..#....# +..##.....# +...##.##.. + +Tile 3631: +..##.#..## +.........# +..##...... +....#..... +#.#.....## +#......... +###....... +#......... +#.#.#.#... +....#.##.. + +Tile 3733: +..#..###.# +.......### +.....##.#. +##.....#.. +##.#....#. +#.##...#.# +###.#.#..# +#.#..#...# +##...#..#. +.#..#...#. + +Tile 2953: +##..#.#... +........#. +..#......# +#.....#... +.........# +##.......# +#..#...... +#.....#.#. +.....#.### +.###..#.## + +Tile 1153: +#.##.##.## +..####.... +.........# +.#..#..... +.....####. +.#.#..##.# +.......#.. +#......... +....#..#.. +...##.#..# + +Tile 3833: +####..#... +##.......# +.........# +.#........ +##..#.###. +#.#..#.#.. +#.#..##... +#........# +#...#..... +......##.. + +Tile 1597: +#...#...## +.....##..# +#.....#..# +#.#.#....# +.###..##.# +##.......# +.......#.. +...#....## +...#...... +.#.##.#.#. + +Tile 3793: +#......#.# +#..#..#.#. +...#...... +##......## +##..#..#.. +.#..#..... +..#.....#. +.#....#... +.....##... +.#..#####. + +Tile 3373: +.#.#.#.... +##.#...... +#...#....# +.......### +#.#.#..#.# +####..#### +..##...... +#..#..#..# +........## +#.##..#.#. + +Tile 1439: +..#####... +.#.....#.# +....#...## +.......... +#....##..# +#....#...# +##........ +#....##..# +.#..##.### +.####.#..# + +Tile 1867: +#..##....# +......#..# +.#.##....# +#...#..... +.#.....#.. +..##...#.. +.#..##.... +#..###.#.. +.#..#.#... +#..#.###.. + +Tile 3343: +..###..... +..#..#..#. +#..####.#. +#......... +.........# +#.#....##. +.#..#....# +#....#...# +.........# +#.....#### + +Tile 2089: +....##.### +#..#.#.#.. +##..#..... +#...#..#.. +#......#.# +.......##. +#.......## +#....##.## +#........# +###.#.#... + +Tile 1747: +...#.....# +#........# +........## +#......##. +#......... +#...##.... +#...#..... +#.#....... +...#....#. +......#### + +Tile 2383: +.#.###...# +#.#....### +..###..#.. +..##...#.# +.......##. +##.....#.. +##...#...# +#......... +.......#.. +##.##..#.. + +Tile 2843: +###......# +..##...... +...#....#. +#....#.... +#........# +#.#.....#. +#.#.#.#... +......#.## +##..#..#.# +#..###.##. + +Tile 3593: +...###..## +###.#.#... +.......#.. +##....#.## +#.......#. +##..#....# +#....#.... +...#...... +.#.#.....# +.#.##..#.. + +Tile 1699: +#.#.#....# +.##.#.#... +#....#...# +#....#..## +...#....#. +.....#...# +..##.#.... +.......#.. +##...##..# +#.##.#.... + +Tile 1579: +##.....### +#..#....#. +#..#.#..#. +#.......## +#.#....#.. +.......... +........## +.#...#...# +#...#.#..# +####.###.. + +Tile 1789: +.#.#...#.. +.......... +##.......# +....##.... +#.#.#..... +#........# +##.#....## +#...#.#... +....#..#.# +..#######. + +Tile 1091: +#.###.##.. +#.##.#..#. +...#....#. +#....#.... +....##.... +##.......# +##....#... +#......#.# +##.......# +#...####.. + +Tile 3607: +#.#.#.##.. +#......#.# +........## +.#.....#.. +.......#.. +#.#..#..## +.#..#.#..# +...#.#.#.. +##..#...## +##.....#.. + +Tile 1367: +#...##.##. +.......... +......#.#. +.#.#..#... +..#...#.#. +#.#......# +.....#.... +...#...... +........## +.#.#.####. + +Tile 1607: +.##.#..#.# +#......... +.......### +##....#..# +##.....##. +#.#.#..... +#......... +##...#.... +#......... +##..##.#.# + +Tile 3739: +...#.##... +#........# +..#..#.#.# +#......#.. +....#..... +##......## +##....#.## +#........# +.......... +##.####..# + +Tile 3989: +#.##..##.. +.....#..## +#......... +.#.##..#.# +..##.##... +........#. +#......... +.##.....## +#.###..#.# +###...###. + +Tile 1723: +..#.#..### +.....##.#. +.##..##... +#..#.##... +..#....##. +...#.#...# +.....#..#. +..#..#..#. +..#..#..## +#.###..##. + +Tile 2029: +##...##... +.......#.# +....##.### +#..#...... +##...#...# +#...#....# +.#.......# +#..#..#.## +....##...# +#####.##.# + +Tile 3637: +.####...#. +.#.#..#..# +#..#..#.## +.....##.#. +...#.#...# +#..#....## +.....##.## +...#...#.. +##....#..# +#.....#.#. + +Tile 3701: +.#.#.#.... +#.###....# +..#..#.### +#.....#.#. +........#. +#.....#... +#...##.### +####..#... +#.....#.#. +#..#....#. + +Tile 1087: +.#..##...# +#...##.... +...#...... +....#..... +#.##....## +#....#.... +#.##.....# +.#..###.## +#..#.....# +.#.#..#.## + +Tile 2617: +#.#..#...# +..###.##.# +##....#### +.........# +.#....#... +......#.## +.......##. +#...#....# +#.......## +#.#.#.#... + +Tile 3581: +...###.### +#....##... +......##.# +......##.. +##....#..# +.###....#. +.#.#..#... +#..#..#..# +.....#...# +.###.#.#.# + +Tile 3697: +..####.### +.#.##..... +.#....#..# +.......... +.###...... +#..#..#.## +#.#..#..## +#..##...#. +..#......# +###..#.#.. + +Tile 2399: +##.###.### +#......... +#..#.##..# +##.#....## +#...#....# +..##..#... +..#..#..## +..##.#.#.# +...##...#. +..#....### + +Tile 2767: +###..##### +.......#.. +#........# +....#..### +.#####..#. +#.#....#.. +....###... +#........# +##........ +.....###.. + +Tile 3463: +....#.#### +#.#......# +..##.#.... +#.#......# +#.##....## +#...#..#.# +#...#.#### +##..#....# +#.#.....## +###...##.. + +Tile 3163: +.##..#.##. +.........# +#.....#... +..#......# +#..#.....# +...#...... +..#......# +.#...#.#.. +.##..###.. +.#.###..#. + +Tile 3709: +##...##.## +#...#..#.. +#..##.#.## +#..##....# +#.#..##..# +#........# +#..#...... +##.###.##. +##.###...# +..##.##.## + +Tile 1571: +#.##.#.##. +##..#..#.# +.......... +#.#.....#. +#.....##.. +..#.#..#.# +###.....## +.......### +...#...... +#.#.#...#. + +Tile 1201: +#...###... +#........# +#.#......# +#..#...#.# +#.....#..# +##..#....# +#........# +......#... +....#..#.. +.##...##.. + +Tile 3121: +..#.#.#..# +.#..#.##.# +..###...#. +...##..... +.....#.... +.#.....##. +..#....... +#.....#... +#......... +#..#....#. + +Tile 1049: +##...#.#.# +#...#..... +.#...#...# +..#...#..# +......##.# +......#### +#..#.....# +#.#....... +#.#..#..#. +##..#.##.# + +Tile 1997: +##.#.#.##. +.......#.# +....#.#..# +..###..... +#.#####.#. +.##...##.# +#.#...#..# +#.#....... +####...... +.#..##..## + +Tile 3329: +.#.##..... +...#.#..#. +...#..##.. +#.#....#.# +...#####.. +#......#.. +#.#..#..#. +...###..#. +#..##..#.. +.###.##.#. + +Tile 1433: +..#...##.. +....#..#.. +.#...#.... +..#.##.... +....##..#. +#...#....# +#.#...#... +.##.#...## +#..#.#.#.. +##.##.##.. + +Tile 1103: +#########. +###.#....# +..#.##..## +##.#..##.. +.....#.... +#...#..#.# +#....#.... +###.#....# +.#..##.#.# +#.#.##.#.. + +Tile 3359: +..#.##.#.# +#......... +#...#....# +##..##.##. +.#......#. +##..#..#.. +#........# +.######... +#...##...# +.....#...# + +Tile 2143: +..#.#####. +#.#.#....# +....#.#... +#....#.... +..#......# +.....#.... +##..##...# +.#.####.#. +..#.#....# +....#..#.# + +Tile 2003: +#.#..#.#.. +......##.# +#.....#.#. +##...#.#.. +#......... +##..#....# +.#####.#.# +......#... +...#..#... +.###.##### + +Tile 3461: +#...#...#. +.#.#.#.#.. +.#.......# +....##.#.# +#...#.#..# +.......... +..#.#..#.. +.#.#....## +.........# +####..#.#. + +Tile 3067: +....###.#. +.#.....#.# +.....#..## +#.#.....## +.##......# +#.#....... +.##......# +.....#.... +....#..... +.#.....#.. + +Tile 2027: +.##.#....# +#....#.#.. +.......##. +.......##. +.........# +..#.....## +..#......# +.#.....#.. +.....#.... +..#.#.#... + +Tile 1951: +#.#.#..#.# +##...#.#.. +.........# +#.####...# +#.....#..# +#..##....# +#...##...# +###......# +...#...... +##....###. + +Tile 1129: +#..###.#.# +#...#..... +#..#..#... +...#...... +#.#.#..#.. +#....#..#. +#........# +#........# +.....#.... +..#.#####. + +Tile 3257: +####.####. +#...#...## +....##.#.. +....#..#.. +......#.## +#.....#..# +......##.. +......#.## +##.....#.# +.#.###..## + +Tile 1223: +#.###.#.#. +#..####..# +.....#...# +##.#.##... +#.....#... +##..#..#.. +...#.###.. +...#..#... +##.....##. +.###.##..# + +Tile 1709: +#.##...... +#.#....... +......##.. +......#... +#.#....... +.##....#.. +.......#.# +.#.#...#.. +.###...#.# +##.###.#.# + +Tile 1019: +...##.##.. +..#.....#. +#......##. +..#....#.# +..#......# +#........# +.##...#... +.......#.# +#..#...... +...#.#.#.#