diff --git a/2015/day15.py b/2015/day15.py new file mode 100644 index 0000000..9436e78 --- /dev/null +++ b/2015/day15.py @@ -0,0 +1,28 @@ +with open('day15-input', 'r') as file: + data = [l.strip('\n') for l in file] +import numpy as np +from itertools import combinations_with_replacement as combi + +ingredients = {} +for line in data: + tokens = line.split() + name = tokens[0].rstrip(':') + values = [int(i.rstrip(',')) for i in tokens[2::2]] + ingredients[name] = values + +ingredients_matrix = np.asmatrix(np.vstack(ingredients.values())) + +max_value = 0 +max_value_500 = 0 +for teaspoons in combi(range(len(ingredients)), 100): + ingredient_amounts = [teaspoons.count(i) for i in range(len(ingredients))] + property_amounts = (ingredients_matrix.T * np.mat(ingredient_amounts).T) + if (property_amounts[:-1] < 1).sum(): # non-positive values for anything other than calories detected, abort + continue + value = np.prod(property_amounts[:-1]) + max_value = max(value, max_value) + if property_amounts[-1] == 500: + max_value_500 = max(value, max_value_500) + +print(max_value) # Part 1 +print(max_value_500) # Part 2 diff --git a/2015/day16-input b/2015/day16-input new file mode 100644 index 0000000..ddaeefc --- /dev/null +++ b/2015/day16-input @@ -0,0 +1,500 @@ +Sue 1: cars: 9, akitas: 3, goldfish: 0 +Sue 2: akitas: 9, children: 3, samoyeds: 9 +Sue 3: trees: 6, cars: 6, children: 4 +Sue 4: trees: 4, vizslas: 4, goldfish: 9 +Sue 5: akitas: 9, vizslas: 7, cars: 5 +Sue 6: vizslas: 6, goldfish: 6, akitas: 3 +Sue 7: pomeranians: 5, samoyeds: 0, perfumes: 10 +Sue 8: cars: 10, pomeranians: 7, goldfish: 8 +Sue 9: trees: 2, vizslas: 7, samoyeds: 6 +Sue 10: perfumes: 5, pomeranians: 4, children: 9 +Sue 11: vizslas: 5, perfumes: 8, cars: 10 +Sue 12: children: 10, cars: 6, perfumes: 5 +Sue 13: cats: 4, samoyeds: 7, pomeranians: 8 +Sue 14: perfumes: 6, goldfish: 10, children: 7 +Sue 15: perfumes: 4, pomeranians: 3, cars: 6 +Sue 16: perfumes: 7, cars: 9, pomeranians: 6 +Sue 17: goldfish: 3, cars: 6, vizslas: 7 +Sue 18: perfumes: 6, cars: 7, goldfish: 3 +Sue 19: trees: 0, akitas: 3, pomeranians: 8 +Sue 20: goldfish: 6, trees: 2, akitas: 6 +Sue 21: pomeranians: 9, akitas: 9, samoyeds: 9 +Sue 22: vizslas: 2, cars: 9, perfumes: 5 +Sue 23: goldfish: 10, samoyeds: 8, children: 9 +Sue 24: akitas: 4, goldfish: 1, vizslas: 5 +Sue 25: goldfish: 10, trees: 8, perfumes: 6 +Sue 26: vizslas: 5, akitas: 8, trees: 1 +Sue 27: trees: 3, cars: 6, perfumes: 2 +Sue 28: goldfish: 8, trees: 7, akitas: 10 +Sue 29: children: 5, trees: 1, goldfish: 10 +Sue 30: vizslas: 3, perfumes: 8, akitas: 3 +Sue 31: cars: 6, children: 10, perfumes: 7 +Sue 32: cars: 10, perfumes: 3, goldfish: 10 +Sue 33: perfumes: 9, vizslas: 3, akitas: 4 +Sue 34: perfumes: 10, vizslas: 7, children: 8 +Sue 35: cars: 5, perfumes: 5, vizslas: 9 +Sue 36: trees: 9, cars: 9, akitas: 7 +Sue 37: samoyeds: 9, perfumes: 2, cars: 10 +Sue 38: akitas: 7, cars: 5, trees: 5 +Sue 39: goldfish: 8, trees: 9, cars: 10 +Sue 40: trees: 0, cats: 1, pomeranians: 1 +Sue 41: pomeranians: 6, perfumes: 9, samoyeds: 1 +Sue 42: vizslas: 6, akitas: 3, pomeranians: 1 +Sue 43: vizslas: 2, perfumes: 3, pomeranians: 6 +Sue 44: akitas: 5, pomeranians: 0, vizslas: 10 +Sue 45: vizslas: 4, goldfish: 1, cars: 5 +Sue 46: cars: 4, vizslas: 8, cats: 0 +Sue 47: cats: 5, children: 8, pomeranians: 2 +Sue 48: vizslas: 3, perfumes: 6, cats: 0 +Sue 49: akitas: 7, perfumes: 0, trees: 7 +Sue 50: trees: 4, akitas: 10, vizslas: 2 +Sue 51: goldfish: 10, cars: 9, trees: 4 +Sue 52: cars: 5, children: 9, perfumes: 0 +Sue 53: vizslas: 5, cars: 3, cats: 8 +Sue 54: cars: 5, akitas: 1, goldfish: 10 +Sue 55: akitas: 10, vizslas: 2, cars: 6 +Sue 56: cats: 6, trees: 0, cars: 4 +Sue 57: vizslas: 1, akitas: 1, samoyeds: 7 +Sue 58: samoyeds: 6, vizslas: 1, akitas: 7 +Sue 59: akitas: 9, cars: 8, vizslas: 1 +Sue 60: cars: 6, vizslas: 7, goldfish: 0 +Sue 61: pomeranians: 5, akitas: 6, vizslas: 2 +Sue 62: samoyeds: 2, cats: 8, goldfish: 7 +Sue 63: vizslas: 10, goldfish: 7, samoyeds: 9 +Sue 64: perfumes: 2, trees: 1, akitas: 6 +Sue 65: cars: 8, perfumes: 10, vizslas: 9 +Sue 66: akitas: 8, vizslas: 8, perfumes: 8 +Sue 67: goldfish: 7, cars: 9, samoyeds: 9 +Sue 68: perfumes: 2, children: 7, akitas: 1 +Sue 69: perfumes: 7, vizslas: 9, akitas: 1 +Sue 70: samoyeds: 3, vizslas: 1, trees: 1 +Sue 71: vizslas: 8, goldfish: 7, trees: 9 +Sue 72: goldfish: 8, cars: 6, trees: 9 +Sue 73: perfumes: 5, cars: 10, samoyeds: 7 +Sue 74: pomeranians: 4, perfumes: 3, cars: 5 +Sue 75: samoyeds: 1, perfumes: 1, pomeranians: 1 +Sue 76: goldfish: 4, cats: 6, akitas: 7 +Sue 77: perfumes: 5, akitas: 4, vizslas: 8 +Sue 78: perfumes: 4, cats: 3, children: 4 +Sue 79: vizslas: 5, pomeranians: 9, samoyeds: 7 +Sue 80: cars: 3, samoyeds: 5, pomeranians: 7 +Sue 81: vizslas: 2, samoyeds: 4, perfumes: 2 +Sue 82: trees: 1, akitas: 10, vizslas: 9 +Sue 83: vizslas: 0, akitas: 2, samoyeds: 5 +Sue 84: perfumes: 5, vizslas: 7, children: 8 +Sue 85: cats: 3, children: 2, trees: 0 +Sue 86: cars: 3, perfumes: 2, goldfish: 2 +Sue 87: trees: 1, akitas: 7, vizslas: 0 +Sue 88: trees: 1, akitas: 2, samoyeds: 1 +Sue 89: cars: 4, vizslas: 8, akitas: 1 +Sue 90: perfumes: 5, cats: 3, vizslas: 0 +Sue 91: samoyeds: 7, cats: 6, goldfish: 8 +Sue 92: samoyeds: 10, cats: 0, cars: 7 +Sue 93: cars: 6, akitas: 7, samoyeds: 2 +Sue 94: perfumes: 0, goldfish: 6, trees: 9 +Sue 95: cars: 6, pomeranians: 2, samoyeds: 8 +Sue 96: cars: 2, trees: 9, samoyeds: 4 +Sue 97: goldfish: 5, trees: 1, children: 0 +Sue 98: akitas: 9, goldfish: 7, children: 6 +Sue 99: goldfish: 9, akitas: 0, pomeranians: 0 +Sue 100: samoyeds: 6, children: 8, vizslas: 5 +Sue 101: vizslas: 6, cars: 5, goldfish: 4 +Sue 102: vizslas: 6, akitas: 2, perfumes: 6 +Sue 103: samoyeds: 3, akitas: 7, children: 4 +Sue 104: cars: 3, perfumes: 10, cats: 6 +Sue 105: vizslas: 9, pomeranians: 0, cars: 1 +Sue 106: cats: 6, samoyeds: 8, pomeranians: 5 +Sue 107: cars: 7, trees: 4, akitas: 10 +Sue 108: perfumes: 3, vizslas: 1, goldfish: 9 +Sue 109: trees: 6, cars: 8, goldfish: 5 +Sue 110: pomeranians: 2, children: 1, vizslas: 7 +Sue 111: akitas: 0, vizslas: 8, cars: 0 +Sue 112: goldfish: 3, vizslas: 6, akitas: 2 +Sue 113: akitas: 10, pomeranians: 7, perfumes: 7 +Sue 114: cars: 10, cats: 2, vizslas: 8 +Sue 115: akitas: 8, trees: 1, vizslas: 2 +Sue 116: vizslas: 2, akitas: 7, perfumes: 1 +Sue 117: goldfish: 0, vizslas: 10, trees: 9 +Sue 118: trees: 3, cars: 0, goldfish: 0 +Sue 119: perfumes: 7, goldfish: 5, trees: 9 +Sue 120: children: 9, vizslas: 3, trees: 5 +Sue 121: vizslas: 1, goldfish: 7, akitas: 10 +Sue 122: perfumes: 1, cars: 6, trees: 1 +Sue 123: akitas: 2, vizslas: 0, goldfish: 7 +Sue 124: vizslas: 10, pomeranians: 7, akitas: 0 +Sue 125: perfumes: 4, cats: 5, vizslas: 2 +Sue 126: cars: 6, samoyeds: 8, akitas: 3 +Sue 127: trees: 9, goldfish: 7, akitas: 9 +Sue 128: cars: 8, trees: 0, perfumes: 2 +Sue 129: pomeranians: 7, vizslas: 2, perfumes: 6 +Sue 130: vizslas: 9, pomeranians: 3, trees: 6 +Sue 131: vizslas: 7, cars: 9, perfumes: 1 +Sue 132: akitas: 2, pomeranians: 9, vizslas: 7 +Sue 133: trees: 9, pomeranians: 10, samoyeds: 0 +Sue 134: children: 4, akitas: 10, perfumes: 4 +Sue 135: vizslas: 1, cats: 1, trees: 8 +Sue 136: samoyeds: 7, cars: 8, goldfish: 5 +Sue 137: perfumes: 0, children: 1, pomeranians: 10 +Sue 138: vizslas: 4, perfumes: 5, cars: 5 +Sue 139: trees: 2, perfumes: 8, goldfish: 0 +Sue 140: cars: 10, akitas: 5, goldfish: 7 +Sue 141: children: 4, trees: 3, goldfish: 8 +Sue 142: cars: 8, perfumes: 6, trees: 7 +Sue 143: akitas: 6, goldfish: 0, trees: 10 +Sue 144: akitas: 7, pomeranians: 10, perfumes: 10 +Sue 145: trees: 10, vizslas: 3, goldfish: 4 +Sue 146: samoyeds: 4, akitas: 3, perfumes: 6 +Sue 147: akitas: 8, perfumes: 2, pomeranians: 10 +Sue 148: cars: 2, perfumes: 0, goldfish: 8 +Sue 149: goldfish: 6, akitas: 7, perfumes: 6 +Sue 150: cars: 2, pomeranians: 5, perfumes: 4 +Sue 151: goldfish: 1, cars: 5, trees: 0 +Sue 152: pomeranians: 4, cars: 7, children: 1 +Sue 153: goldfish: 8, cars: 1, children: 10 +Sue 154: cars: 6, perfumes: 8, trees: 1 +Sue 155: akitas: 4, perfumes: 6, pomeranians: 2 +Sue 156: pomeranians: 5, cars: 4, akitas: 1 +Sue 157: cats: 5, cars: 9, goldfish: 8 +Sue 158: vizslas: 5, samoyeds: 1, children: 7 +Sue 159: vizslas: 1, perfumes: 3, akitas: 1 +Sue 160: goldfish: 10, pomeranians: 9, perfumes: 5 +Sue 161: samoyeds: 3, trees: 7, cars: 2 +Sue 162: cars: 2, pomeranians: 1, vizslas: 6 +Sue 163: vizslas: 3, perfumes: 5, akitas: 6 +Sue 164: vizslas: 1, trees: 0, akitas: 5 +Sue 165: vizslas: 5, cars: 6, pomeranians: 8 +Sue 166: cars: 10, perfumes: 2, trees: 9 +Sue 167: cars: 10, pomeranians: 6, perfumes: 4 +Sue 168: akitas: 7, trees: 10, goldfish: 7 +Sue 169: akitas: 1, perfumes: 10, cars: 10 +Sue 170: akitas: 5, samoyeds: 8, vizslas: 6 +Sue 171: children: 3, akitas: 2, vizslas: 3 +Sue 172: goldfish: 5, vizslas: 5, perfumes: 9 +Sue 173: perfumes: 5, goldfish: 10, trees: 5 +Sue 174: akitas: 5, vizslas: 2, children: 7 +Sue 175: perfumes: 5, cars: 7, samoyeds: 2 +Sue 176: cars: 8, vizslas: 10, akitas: 7 +Sue 177: perfumes: 7, children: 8, goldfish: 7 +Sue 178: cars: 1, pomeranians: 9, samoyeds: 0 +Sue 179: perfumes: 6, cars: 2, trees: 6 +Sue 180: trees: 3, vizslas: 7, children: 3 +Sue 181: vizslas: 8, samoyeds: 2, trees: 9 +Sue 182: perfumes: 3, cats: 1, children: 5 +Sue 183: akitas: 9, cats: 6, children: 3 +Sue 184: pomeranians: 9, cars: 6, perfumes: 8 +Sue 185: vizslas: 9, trees: 0, akitas: 9 +Sue 186: perfumes: 6, cars: 5, goldfish: 5 +Sue 187: perfumes: 4, cats: 7, vizslas: 2 +Sue 188: akitas: 7, cars: 4, children: 10 +Sue 189: akitas: 0, goldfish: 7, vizslas: 5 +Sue 190: akitas: 5, cars: 5, cats: 6 +Sue 191: cars: 6, children: 0, perfumes: 3 +Sue 192: cats: 2, perfumes: 10, goldfish: 7 +Sue 193: trees: 1, perfumes: 0, cars: 8 +Sue 194: perfumes: 9, children: 4, cats: 6 +Sue 195: akitas: 7, trees: 3, goldfish: 6 +Sue 196: goldfish: 8, cars: 8, samoyeds: 0 +Sue 197: cats: 0, akitas: 10, vizslas: 0 +Sue 198: goldfish: 1, perfumes: 3, cars: 8 +Sue 199: akitas: 10, vizslas: 5, samoyeds: 6 +Sue 200: pomeranians: 9, goldfish: 9, samoyeds: 7 +Sue 201: samoyeds: 0, goldfish: 7, akitas: 6 +Sue 202: vizslas: 0, goldfish: 2, akitas: 1 +Sue 203: goldfish: 3, children: 0, vizslas: 8 +Sue 204: cars: 8, trees: 2, perfumes: 2 +Sue 205: cars: 4, perfumes: 5, goldfish: 8 +Sue 206: vizslas: 3, trees: 2, akitas: 1 +Sue 207: cars: 7, goldfish: 5, trees: 1 +Sue 208: goldfish: 1, cars: 6, vizslas: 8 +Sue 209: cats: 4, trees: 1, children: 0 +Sue 210: cats: 10, children: 0, perfumes: 0 +Sue 211: cars: 4, pomeranians: 7, samoyeds: 5 +Sue 212: cars: 2, pomeranians: 10, trees: 1 +Sue 213: trees: 10, cats: 5, cars: 10 +Sue 214: perfumes: 5, trees: 1, vizslas: 1 +Sue 215: akitas: 10, vizslas: 8, samoyeds: 8 +Sue 216: vizslas: 2, cats: 5, pomeranians: 3 +Sue 217: akitas: 10, perfumes: 0, cats: 10 +Sue 218: trees: 8, cats: 5, vizslas: 2 +Sue 219: goldfish: 10, perfumes: 8, children: 2 +Sue 220: samoyeds: 9, trees: 8, vizslas: 7 +Sue 221: children: 7, trees: 6, cars: 6 +Sue 222: cats: 4, akitas: 5, pomeranians: 0 +Sue 223: trees: 8, goldfish: 2, perfumes: 8 +Sue 224: pomeranians: 9, cars: 8, akitas: 5 +Sue 225: akitas: 10, vizslas: 0, trees: 2 +Sue 226: akitas: 8, cats: 6, cars: 7 +Sue 227: trees: 1, akitas: 3, goldfish: 4 +Sue 228: pomeranians: 6, cats: 3, goldfish: 3 +Sue 229: trees: 10, perfumes: 3, vizslas: 7 +Sue 230: perfumes: 8, cars: 7, akitas: 0 +Sue 231: perfumes: 10, goldfish: 4, cars: 6 +Sue 232: goldfish: 7, trees: 3, cats: 2 +Sue 233: perfumes: 6, trees: 4, akitas: 4 +Sue 234: goldfish: 9, cats: 4, cars: 7 +Sue 235: pomeranians: 6, vizslas: 0, akitas: 6 +Sue 236: samoyeds: 5, cars: 5, children: 4 +Sue 237: vizslas: 10, cars: 4, goldfish: 4 +Sue 238: goldfish: 3, samoyeds: 7, akitas: 2 +Sue 239: cats: 8, children: 2, vizslas: 7 +Sue 240: cars: 9, perfumes: 4, trees: 9 +Sue 241: trees: 8, vizslas: 2, goldfish: 5 +Sue 242: cars: 6, trees: 3, vizslas: 3 +Sue 243: cats: 6, children: 7, cars: 4 +Sue 244: cats: 10, perfumes: 2, goldfish: 7 +Sue 245: akitas: 8, cats: 10, perfumes: 8 +Sue 246: vizslas: 8, akitas: 5, perfumes: 10 +Sue 247: goldfish: 2, vizslas: 5, akitas: 7 +Sue 248: akitas: 3, perfumes: 0, trees: 10 +Sue 249: cats: 4, vizslas: 5, pomeranians: 6 +Sue 250: children: 3, vizslas: 7, perfumes: 2 +Sue 251: cars: 0, pomeranians: 10, perfumes: 0 +Sue 252: akitas: 0, goldfish: 9, cars: 6 +Sue 253: perfumes: 7, cars: 4, samoyeds: 5 +Sue 254: akitas: 9, trees: 10, cars: 4 +Sue 255: samoyeds: 10, children: 6, akitas: 7 +Sue 256: trees: 8, goldfish: 8, perfumes: 8 +Sue 257: goldfish: 3, akitas: 2, perfumes: 6 +Sue 258: cats: 7, trees: 0, vizslas: 1 +Sue 259: perfumes: 7, cars: 7, akitas: 7 +Sue 260: goldfish: 0, vizslas: 0, samoyeds: 2 +Sue 261: vizslas: 2, children: 2, cats: 3 +Sue 262: vizslas: 2, pomeranians: 9, samoyeds: 3 +Sue 263: cats: 1, akitas: 3, vizslas: 1 +Sue 264: pomeranians: 10, trees: 2, goldfish: 7 +Sue 265: samoyeds: 5, trees: 7, perfumes: 4 +Sue 266: perfumes: 10, cars: 1, pomeranians: 3 +Sue 267: trees: 6, goldfish: 1, cars: 0 +Sue 268: cars: 6, samoyeds: 4, pomeranians: 5 +Sue 269: goldfish: 3, vizslas: 3, akitas: 3 +Sue 270: children: 5, cats: 0, cars: 4 +Sue 271: goldfish: 3, perfumes: 8, pomeranians: 7 +Sue 272: samoyeds: 6, cars: 7, perfumes: 10 +Sue 273: trees: 4, cars: 2, vizslas: 7 +Sue 274: samoyeds: 10, perfumes: 9, goldfish: 6 +Sue 275: cars: 4, trees: 2, perfumes: 7 +Sue 276: akitas: 3, perfumes: 9, cars: 9 +Sue 277: akitas: 8, vizslas: 2, cats: 6 +Sue 278: trees: 5, goldfish: 7, akitas: 3 +Sue 279: perfumes: 9, cars: 8, vizslas: 2 +Sue 280: trees: 3, vizslas: 0, children: 0 +Sue 281: cars: 7, trees: 2, cats: 5 +Sue 282: vizslas: 4, cars: 10, cats: 3 +Sue 283: akitas: 10, cats: 3, samoyeds: 9 +Sue 284: trees: 7, children: 5, goldfish: 6 +Sue 285: cars: 2, perfumes: 5, cats: 7 +Sue 286: samoyeds: 5, trees: 10, goldfish: 6 +Sue 287: goldfish: 10, perfumes: 4, trees: 7 +Sue 288: vizslas: 9, trees: 9, perfumes: 0 +Sue 289: trees: 4, goldfish: 9, vizslas: 8 +Sue 290: vizslas: 3, cars: 3, trees: 2 +Sue 291: goldfish: 2, akitas: 2, trees: 2 +Sue 292: children: 1, cars: 0, vizslas: 5 +Sue 293: trees: 5, akitas: 4, goldfish: 6 +Sue 294: akitas: 3, vizslas: 7, pomeranians: 5 +Sue 295: goldfish: 10, vizslas: 3, trees: 1 +Sue 296: cars: 2, trees: 1, akitas: 0 +Sue 297: akitas: 10, vizslas: 6, samoyeds: 2 +Sue 298: children: 5, trees: 1, samoyeds: 9 +Sue 299: perfumes: 9, trees: 6, vizslas: 1 +Sue 300: akitas: 7, pomeranians: 6, vizslas: 6 +Sue 301: cats: 7, children: 6, vizslas: 7 +Sue 302: trees: 2, vizslas: 7, samoyeds: 4 +Sue 303: goldfish: 0, samoyeds: 10, cars: 4 +Sue 304: pomeranians: 9, children: 3, vizslas: 5 +Sue 305: akitas: 8, vizslas: 4, cars: 5 +Sue 306: akitas: 0, perfumes: 2, pomeranians: 10 +Sue 307: akitas: 9, cars: 0, trees: 2 +Sue 308: vizslas: 10, goldfish: 8, akitas: 6 +Sue 309: trees: 0, cats: 6, perfumes: 2 +Sue 310: vizslas: 10, cars: 1, trees: 4 +Sue 311: goldfish: 8, perfumes: 6, cats: 3 +Sue 312: goldfish: 0, children: 1, akitas: 2 +Sue 313: pomeranians: 10, trees: 6, samoyeds: 6 +Sue 314: vizslas: 5, akitas: 4, pomeranians: 2 +Sue 315: goldfish: 7, trees: 0, akitas: 5 +Sue 316: goldfish: 4, vizslas: 5, cars: 7 +Sue 317: perfumes: 7, cats: 10, cars: 4 +Sue 318: samoyeds: 10, cars: 9, trees: 7 +Sue 319: pomeranians: 8, vizslas: 6, cars: 3 +Sue 320: cars: 4, cats: 9, akitas: 4 +Sue 321: cars: 6, trees: 2, perfumes: 6 +Sue 322: goldfish: 1, cats: 2, perfumes: 4 +Sue 323: akitas: 6, cats: 5, cars: 8 +Sue 324: cats: 4, vizslas: 9, akitas: 0 +Sue 325: children: 8, samoyeds: 9, trees: 4 +Sue 326: vizslas: 2, samoyeds: 10, perfumes: 7 +Sue 327: goldfish: 7, pomeranians: 4, akitas: 10 +Sue 328: perfumes: 8, cats: 4, akitas: 10 +Sue 329: trees: 0, cars: 9, goldfish: 3 +Sue 330: trees: 5, samoyeds: 7, perfumes: 8 +Sue 331: cars: 4, perfumes: 2, goldfish: 0 +Sue 332: vizslas: 4, pomeranians: 7, akitas: 1 +Sue 333: akitas: 4, goldfish: 3, perfumes: 0 +Sue 334: samoyeds: 3, akitas: 10, vizslas: 0 +Sue 335: goldfish: 1, akitas: 7, vizslas: 6 +Sue 336: perfumes: 1, goldfish: 1, pomeranians: 8 +Sue 337: children: 5, cars: 4, cats: 4 +Sue 338: vizslas: 5, cars: 10, cats: 3 +Sue 339: trees: 2, goldfish: 3, cars: 1 +Sue 340: trees: 10, goldfish: 6, perfumes: 2 +Sue 341: akitas: 5, trees: 6, cats: 3 +Sue 342: cars: 10, children: 8, goldfish: 0 +Sue 343: cats: 2, akitas: 0, pomeranians: 4 +Sue 344: perfumes: 1, vizslas: 3, cars: 3 +Sue 345: samoyeds: 8, cats: 5, perfumes: 8 +Sue 346: cars: 5, akitas: 10, trees: 2 +Sue 347: vizslas: 9, akitas: 9, cars: 3 +Sue 348: cars: 3, perfumes: 1, pomeranians: 9 +Sue 349: akitas: 1, cars: 4, perfumes: 0 +Sue 350: perfumes: 8, vizslas: 2, trees: 6 +Sue 351: pomeranians: 5, akitas: 9, cats: 8 +Sue 352: pomeranians: 8, vizslas: 3, goldfish: 10 +Sue 353: trees: 2, pomeranians: 0, goldfish: 6 +Sue 354: cats: 5, akitas: 7, goldfish: 6 +Sue 355: goldfish: 6, children: 4, trees: 10 +Sue 356: children: 1, trees: 3, akitas: 7 +Sue 357: trees: 2, samoyeds: 10, goldfish: 3 +Sue 358: samoyeds: 10, cats: 0, goldfish: 0 +Sue 359: perfumes: 3, children: 6, pomeranians: 1 +Sue 360: cars: 10, pomeranians: 1, samoyeds: 5 +Sue 361: samoyeds: 9, pomeranians: 7, perfumes: 6 +Sue 362: goldfish: 6, trees: 8, perfumes: 9 +Sue 363: samoyeds: 10, pomeranians: 9, children: 10 +Sue 364: perfumes: 3, goldfish: 7, cars: 9 +Sue 365: cats: 3, children: 4, samoyeds: 8 +Sue 366: trees: 0, cars: 10, vizslas: 10 +Sue 367: pomeranians: 10, children: 8, perfumes: 2 +Sue 368: cars: 5, vizslas: 0, samoyeds: 3 +Sue 369: trees: 1, goldfish: 8, cars: 8 +Sue 370: vizslas: 0, cars: 2, perfumes: 5 +Sue 371: trees: 2, cars: 3, vizslas: 8 +Sue 372: trees: 10, children: 9, cats: 1 +Sue 373: pomeranians: 3, perfumes: 1, vizslas: 0 +Sue 374: vizslas: 0, perfumes: 6, trees: 0 +Sue 375: vizslas: 7, pomeranians: 1, akitas: 10 +Sue 376: vizslas: 8, trees: 2, cars: 10 +Sue 377: perfumes: 9, cats: 5, goldfish: 5 +Sue 378: cats: 0, akitas: 10, perfumes: 9 +Sue 379: cars: 4, akitas: 1, trees: 1 +Sue 380: cars: 4, perfumes: 5, trees: 3 +Sue 381: goldfish: 3, akitas: 5, samoyeds: 9 +Sue 382: goldfish: 7, perfumes: 5, trees: 5 +Sue 383: akitas: 4, cats: 6, cars: 8 +Sue 384: children: 6, goldfish: 10, akitas: 7 +Sue 385: akitas: 7, vizslas: 5, perfumes: 10 +Sue 386: children: 7, vizslas: 10, akitas: 10 +Sue 387: goldfish: 6, akitas: 7, trees: 2 +Sue 388: vizslas: 6, trees: 1, akitas: 2 +Sue 389: cars: 5, vizslas: 3, akitas: 7 +Sue 390: vizslas: 4, cats: 8, perfumes: 7 +Sue 391: akitas: 3, trees: 0, children: 2 +Sue 392: cats: 7, cars: 3, children: 9 +Sue 393: trees: 10, vizslas: 3, goldfish: 7 +Sue 394: perfumes: 0, goldfish: 7, akitas: 4 +Sue 395: cats: 6, cars: 7, vizslas: 0 +Sue 396: vizslas: 4, perfumes: 6, goldfish: 5 +Sue 397: pomeranians: 8, trees: 1, akitas: 9 +Sue 398: goldfish: 7, pomeranians: 6, samoyeds: 9 +Sue 399: perfumes: 10, cars: 1, trees: 8 +Sue 400: trees: 0, goldfish: 9, children: 6 +Sue 401: trees: 1, cars: 6, pomeranians: 8 +Sue 402: perfumes: 9, cars: 0, vizslas: 10 +Sue 403: samoyeds: 4, akitas: 1, vizslas: 9 +Sue 404: perfumes: 0, trees: 2, cars: 4 +Sue 405: akitas: 0, perfumes: 5, samoyeds: 4 +Sue 406: akitas: 8, vizslas: 6, children: 2 +Sue 407: children: 1, trees: 8, goldfish: 10 +Sue 408: pomeranians: 4, trees: 10, cars: 9 +Sue 409: perfumes: 5, vizslas: 5, akitas: 4 +Sue 410: trees: 1, akitas: 10, vizslas: 6 +Sue 411: samoyeds: 0, goldfish: 9, perfumes: 7 +Sue 412: goldfish: 7, samoyeds: 10, trees: 1 +Sue 413: samoyeds: 0, pomeranians: 10, vizslas: 6 +Sue 414: children: 2, cars: 10, samoyeds: 2 +Sue 415: trees: 2, goldfish: 8, cars: 0 +Sue 416: samoyeds: 4, goldfish: 9, trees: 2 +Sue 417: trees: 8, akitas: 10, perfumes: 3 +Sue 418: samoyeds: 9, goldfish: 2, cars: 1 +Sue 419: akitas: 2, perfumes: 8, trees: 2 +Sue 420: children: 3, goldfish: 6, perfumes: 5 +Sue 421: akitas: 8, perfumes: 2, samoyeds: 6 +Sue 422: vizslas: 10, akitas: 4, pomeranians: 3 +Sue 423: cats: 8, perfumes: 3, trees: 4 +Sue 424: cars: 2, children: 4, pomeranians: 8 +Sue 425: pomeranians: 4, samoyeds: 2, goldfish: 4 +Sue 426: perfumes: 6, cars: 4, goldfish: 4 +Sue 427: akitas: 0, goldfish: 7, perfumes: 5 +Sue 428: perfumes: 4, cars: 3, akitas: 5 +Sue 429: trees: 0, vizslas: 0, goldfish: 1 +Sue 430: perfumes: 4, vizslas: 2, cars: 7 +Sue 431: goldfish: 7, pomeranians: 8, trees: 0 +Sue 432: goldfish: 7, children: 9, trees: 3 +Sue 433: akitas: 1, vizslas: 10, trees: 2 +Sue 434: perfumes: 2, cars: 4, goldfish: 10 +Sue 435: pomeranians: 6, vizslas: 9, trees: 1 +Sue 436: cars: 9, trees: 0, goldfish: 0 +Sue 437: trees: 1, goldfish: 1, vizslas: 8 +Sue 438: goldfish: 7, samoyeds: 8, children: 2 +Sue 439: children: 1, cats: 7, vizslas: 8 +Sue 440: cats: 2, pomeranians: 6, goldfish: 4 +Sue 441: perfumes: 7, cats: 3, vizslas: 6 +Sue 442: akitas: 4, samoyeds: 5, cars: 2 +Sue 443: akitas: 3, perfumes: 3, cats: 9 +Sue 444: perfumes: 10, akitas: 6, trees: 0 +Sue 445: cars: 5, children: 9, perfumes: 8 +Sue 446: vizslas: 10, cars: 3, perfumes: 5 +Sue 447: children: 9, perfumes: 1, cars: 10 +Sue 448: akitas: 0, goldfish: 8, trees: 3 +Sue 449: cars: 7, akitas: 8, children: 3 +Sue 450: cars: 4, akitas: 9, cats: 0 +Sue 451: perfumes: 4, samoyeds: 5, goldfish: 6 +Sue 452: perfumes: 10, akitas: 1, cars: 7 +Sue 453: trees: 1, goldfish: 3, vizslas: 6 +Sue 454: goldfish: 8, pomeranians: 6, trees: 10 +Sue 455: akitas: 5, vizslas: 8, goldfish: 10 +Sue 456: cats: 5, trees: 4, samoyeds: 0 +Sue 457: perfumes: 8, cars: 0, cats: 3 +Sue 458: akitas: 1, trees: 10, vizslas: 2 +Sue 459: vizslas: 6, akitas: 3, children: 10 +Sue 460: perfumes: 7, trees: 9, goldfish: 8 +Sue 461: children: 6, vizslas: 4, perfumes: 5 +Sue 462: vizslas: 6, akitas: 8, perfumes: 9 +Sue 463: goldfish: 8, cars: 4, trees: 10 +Sue 464: pomeranians: 8, cars: 5, vizslas: 0 +Sue 465: cats: 10, goldfish: 7, akitas: 1 +Sue 466: cats: 2, children: 1, cars: 6 +Sue 467: perfumes: 3, samoyeds: 6, cars: 0 +Sue 468: samoyeds: 10, pomeranians: 6, trees: 2 +Sue 469: children: 2, perfumes: 2, pomeranians: 4 +Sue 470: cats: 1, perfumes: 5, vizslas: 9 +Sue 471: vizslas: 5, perfumes: 2, akitas: 7 +Sue 472: samoyeds: 8, goldfish: 6, cats: 1 +Sue 473: goldfish: 10, perfumes: 9, cars: 4 +Sue 474: samoyeds: 0, cars: 4, vizslas: 4 +Sue 475: trees: 2, cars: 7, akitas: 8 +Sue 476: vizslas: 3, perfumes: 5, goldfish: 1 +Sue 477: cats: 7, cars: 4, trees: 1 +Sue 478: vizslas: 8, akitas: 3, goldfish: 0 +Sue 479: cars: 6, cats: 3, perfumes: 2 +Sue 480: goldfish: 1, children: 9, vizslas: 3 +Sue 481: pomeranians: 5, vizslas: 1, cars: 10 +Sue 482: children: 5, perfumes: 5, cats: 1 +Sue 483: perfumes: 2, goldfish: 7, trees: 6 +Sue 484: akitas: 2, goldfish: 4, perfumes: 10 +Sue 485: samoyeds: 3, goldfish: 0, akitas: 1 +Sue 486: trees: 8, vizslas: 9, goldfish: 0 +Sue 487: goldfish: 8, samoyeds: 0, trees: 0 +Sue 488: perfumes: 7, cars: 5, trees: 0 +Sue 489: vizslas: 3, pomeranians: 2, perfumes: 5 +Sue 490: cars: 5, perfumes: 5, akitas: 5 +Sue 491: children: 8, trees: 1, pomeranians: 4 +Sue 492: pomeranians: 0, akitas: 1, vizslas: 8 +Sue 493: akitas: 10, perfumes: 10, samoyeds: 8 +Sue 494: perfumes: 6, vizslas: 4, cats: 6 +Sue 495: children: 6, pomeranians: 5, samoyeds: 4 +Sue 496: vizslas: 1, trees: 5, akitas: 1 +Sue 497: vizslas: 10, perfumes: 10, pomeranians: 3 +Sue 498: samoyeds: 3, trees: 2, cars: 5 +Sue 499: cats: 6, children: 3, perfumes: 0 +Sue 500: pomeranians: 10, cats: 3, vizslas: 5 diff --git a/2015/day18-input b/2015/day18-input new file mode 100644 index 0000000..e91a2a7 --- /dev/null +++ b/2015/day18-input @@ -0,0 +1,100 @@ +###.##..##.#..#.##...#..#.####..#.##.##.##..###...#....#...###..#..###..###.#.#.#..#.##..#...##.#..# +.#...##.#####..##.......#..####.###.##.#..###.###.....#.#.####.##.###..##...###....#.##.....#.#.#.## +.....#.#.....#..###..####..#.....##.#..###.####.#.######..##......#####.#.##.#########.###..#.##.#.# +...###......#.#..###..#.#.....#.##..#.##..###...#.##.#..#..#.##.#..##......##.##.##.######...#....## +.###.....#...#.#...####.#.###..#..####.#..#.##..####...##.#...#..###...###...####..##....####.##..#. +..#....#...#.......#..###.###....#.##..#.....###.#.##.#....#.#....##.##..#.##.#..###.###.##.##..##.# +##..#####.#.#....#.#...#.#.####..#....#..#....#.#..#.#####...#..##.#.....#.##..##.####......#.#.##.. +.#..##..#.#.###..##..##...#....##...#..#.#..##.##..###.####.....#.####.#.....##.#.##...#..####..#... +#.#####.......#####...#...####.#.#.#....#.###.#.##.#####..#.###.#..##.##.#.##....#.##..#....####.#.# +#.##...#####....##.#.#.....##......##.##...#.##.##...##...###.###.##.#.####.####.##..#.##.#.#.####.. +#.##.##....###.###.#..#..##.##.#..#.#..##..#.#...#.##........###..#...##.#.#.##.......##.....#...### +###..#.#..##.##.#.#.#...#..#...##.##.#.########.......#.#...#....########..#.#.###..#.#..#.##..##### +####.#.#...#.##.##..#.#...#....#..###..#.#.#.####.#.##.##.#..##..##..#..#####.####.##..########..##. +.#.#...#..##.#..#..###.#..####.......##.#.#.#.##.#####..#..##...#.##...#..#....#..#..###..####.#.... +..#.#...#....##...#####..#..#...###.###.....#.###.#....#.#..##...#.##.##.####.#.#.#..#.##.#....#.#.. +#....###.####.##..#.#.###..###.##.##..#.#...###..#.##.#####.##.#######..#.#...##.#..........####.### +#.#####.#......#.#......#.....##...##.#.#########.#......##..##..##.#..##.##..#....##...###...#.#... +#..#..##..###.#.#.#.#.....###.#.####.##.##....#.#..##....#.#..#.####..###.##...#######.#####.##.#.#. +..###.#........##.#...###..#.##..#.#....##.#......#..#.##..#.#..#.#..#.####.#####..###.##..#.##.#... +##.###....#..##...#..#.#......##..#...#..#.####..#.##...##.####.#...#..###...#.#.#....###.##..#.#... +..##.##.#.##..##.#..#.###...##..##..#....##..##...####.#..####.###...#.....#..#.##..##..###..#.#...# +#.#....#.....#...##.#...####..#..##..##.####..##..##...####...#....##.#.#######..##.#......######.#. +#.#...###.######.######..##..##....#.#......#......#.#.##.#.##.#.#.#...#...#....#.#.#.#..#.##..#...# +####.###.#.#.##..#.##.#...#.##...#.##.##...#.....#.#..#.####.##..######.#..#.#..##....#.#.#..#.#.#.# +..##......#.#...#.##.##..##..##..#..##..#########.#..###..###.##...#..##.#..#.#.#.######..#....#.#.. +..##.##.#...###.#...##..######.##.#..####..#..#.#.##.####.##.##.#...##....#...###.##.####..#....#.#. +####...###..#.#.##.#.#....###..##.#.#..########..#...#.#...#.##....##.##...#.....#.#.....#.....#.... +.#.###############....#.##..###..#.####.#.##.##..#..#.#...###...##..##.##.#.....##...###.###.....#.. +.###..#..##.##..####.#.###.##.##..#..##....#.#......#......##.#...#.#...#..##.#.#...#...#.##..#.##.. +###.#.#.########.#.#..####.#..##.#.##.##.###.##..######...#..##.##.#..#.#...#.##..#####.....#.#.#..# +.##.##..#.#...#####.#.#.###...##...####...#......#...#..####..#.##..........#..#.#..###....######.## +..#####...#.#.#.#..#.##..#...#.#..#.##...##..##.##.#.##.#..#.#...#.......##.#...###.....#...#.#.#.## +##.##.#..######.##...#.....#.###.#..##.#.#.#..####.#....##.#....####...##....#.#.##.#..###.##.##..## +.###.##.#..#.###.####..#.##..####.#.#.##..###.#######.###.###...####........##....###.#...#.#.####.# +........#..#.#..##..########..........#.##.#..##.#...#.....####....##..#..#.#####.###...#...#.##.### +.....#..##.####...##.#####..######.##.#.###.####.##.##.#..##.##.######.##......#..#.####..##....#.## +##...####....#.##.##.###....#.#...#.####..##.#.##.#.#...####.#.#.#.#...##.###...##...###...######.## +.#....#.#.####...#.##.....##...###.#.#.##...##.#####....#.######.#.#....##..##...##....##.#.##.#.#.# +.###..###.#.......#.#######..#.#.#.######....#.#####.#.....#.#########...#....##...##.####.#..#..... +##.#..##..##.....#..##...#..##.##.#..#.#####.##.##.#.##.##...##.######.####..#.##..#####.##...##..#. +#.###...##.#.#.#.##....#.#.##.##..#....#...#.#.........#..#..####..####.####..#.##.##.#....####..##. +.#..######..#####.####.##.#.....#.#.#####..##..###.#.#.#..#.#...#.#######..##....##.##...#######..#. +#...#....#.#.##..#####..#########..#.....#...##.#.#.###...#####..##...##...####.......#######.#..### +.#......#...##.###..#....#...#.#.....#.#...##.#.#..#..###.##.###.#.##..##...#.##......#.###..#.#..## +.#....####...###..#.....##..#...#.#.###.#.#.##...#.##.##.#.#.#..####..###.#.#.#.##.#.#...#..#...#### +......##.##.#...#####.##..#.###..#.#####..##.#..##.###......#...#...#..#......###.######...#.#.##..# +###..#...#.##..###.#....##...#..#####.#.#..#.###...#####.#....##..####.#.##...#.#...##..#.#.#.#..#.# +...##.#.##.##..#.#.#.###.#.#...#.....###.###.##...#.###.##...##..#..###.#..##.##..###.#....###..##.. +.##.#..###..###.##.##...#..#####...#.....#####.##..####...#.##.#.#..##.#.#.#....###.....#....##..... +######.#..#.#..#....#.###...####.####.#.........#..##.#..##..##.....#..#.##.##...#...#####.#.##..#.# +.##.###...####....#.####...#####..#..#...#..#.....###.#..#.###..#.###.#.......##.####..#.##.#...##.. +........#.#.##.#.....#####.###......##..#.##.#..#...####.#...#..###.#.#...##..#.#...#.####...#.#.### +.#..#.##..##...######.###.##.#.#...#.#.#.#.##..##..##.#.##..#....#.##...#.##.##...##....##.###.##.#. +##...#...#...###.#.#...#...#..###......##.#.#....##..##.#..##.#.######...#..##.#.##.#.#....#.##.##.. +...#..###.#....#...#.##..##.#.##.#..###.##..#.##..####.#########....#.....##.#.##.##..##.##.######.# +#.##.#..##.......###...#.###....###.#..####..##.#####.##.###....##....#.###...####..#.#.#.##.....### +.......#...#...##.#...##.#.#..#.##..##.#....###...##.#####...#.........#.......###.##.#.#.###....##. +###.#.##.##.....#.#..#.#..####.####..#..###..........####.#.##...#######.###..#####..#.....#..###..# +#...##.##..####.##.###.#.#######..###.#..#######..#.##.####...#..#.##.####..####.#.#.......####.#... +...#.##..#..#..##........#.#..#..#.#....#.###.#.###..#.......###..#.....#....#..##.#...#.###...##.#. +###.##..#.##.#.#####..#.##.####....#####..###.#.#..#...#...###.#.##..#.#.#.....#.####.#.#.#.#.#.#... +..##..##..#..##.##.#...#..#....####....#...#..####..#.....######.###.####.#....##....##.#.#.###....# +.#.#.#.##..####..#.....#.####.#....#.....#....#.##..#.#..#.#...#.#.#.#..#..#..##.#....####.......#.. +..##.##..###......#...#..##...#.###.####.#...#.####..#.#.#.....#.#...####...#.########.##.#.#.#..### +#....#.##.....##.###.##.###..#.####.....####.##...#..##.###...###..###.#....####.#..#..#..#.#..##.#. +.#.#.##....#.##......#.#..###.#....###....#......#.#.##.##.#########..##..#...#.####..#...####..#..# +.#.#.......##.#.##.#...#...#.##.#..#.#.#.##....#..###.###.##.#.#...##.#..#..##....#..###.#...#.#.##. +#.##.#....####...#..##..#.#.#.#.##.#...#####.#...#..#..#.####.####.#.#....#......##..##..###...#..## +..##.###..##.####..#..#..##...###.#.#.#######.####...####......##.##..#...#.##...##....#..#..#.....# +....#..#..#.#.####.#...##..#....####.#..####...#.#...###...#..#..##...#....##...#.....#.#..#.#.#...# +...#.#.#.##..##.###..#.######....####.###...##...###.#...##.####..#.#..#.#..#.##.....#.#.#..##...... +.#.##.##.....##.#..###.###.##....#...###.#......#...##.###.#.##.##...###...###...#.######..#......#. +###..#...#......#..##...#....##.#..###.##.####..##..##....####.#...#.#....##..#.#######..#.#.#####.. +##...#####..####..##....#.#.###.##.#..#.#..#.....###...###.#####.....#..##.#......#...#.###.##.##... +...#.#.#..#.###..#.#.#....##.#.#..####.##.#.####.#.#.#...#....##....#.##.####..###.#.#...##.#..#..## +#.#.#..#.##..##.##.#...##.#....#...###..##..#.#######.#.###..##......##.#..###.########.#.##..#.#.## +######.###....##..#..#...####....#.#.#..#...#..######.#.#.##..##....##....##.##.##...#..#.####.#.#.. +#####.###..#..###......##...##.####.#.#.#.###.......##..##.####..##.####.#..#..####..#.####.#####... +##.#.#.###..##.#.##.#.#.#.##.#...##........###.#.##..####....###.#.####.####.#.......##.##.##...##.. +#.#..###...#..##.....##.#..#.#..##..######.#####...###.#.......###...#..##..#..#..##.#.#....#..#..#. +#.#..####.###..#...#...#...#.###..#.#.#.#.#.#.#..#....#.##.##.##..###..####.#..##..##.###.###....##. +#..#.##.#####........#..#.##.#..##.#...#....#..#.##..###..##..##.##..#..##.#.#...#.#.##.#.##....#.#. +.......##..#.....#..#.#.....#.##...####.###..####..#.#.#.#..#.....#....##...#..#.##..###.#.#....#... +#...###########.##.....##...###.#.##.##..####.##...#.####.#####.#####.####...###.##...##..#.#.###..# +....#.#.###.####.###...#...#.#..###.#.#.##...#..#.#.#..#.####..#..###.######.#.####.###...###.#.##.# +.....#..#..########...#.#.#.#.#.#.#.#..###.##..####...##.#.#.#...##..#####.##.#...#.####.#######.##. +.......#...#.#..#..#...#..#..##.....#.##....##.##...##..##.##...##...#.#..#.##.#.###.#.####.#.#..##. +.####...#...#.#.#....##..........##.##.###.##.#.#..#.#.#......########.#...#.####.##.###..##...####. +#.#.#...##.###..##..#..#.....####.#.....##.##.#..#.#.###.#..#######...##..#.#..#.#..############.### +.##..####.#..#.....###..#..#.#.....#.#.#...##.##.#....#..#..###.#...#....#.#...####..#.....###.####. +..#...#.###.###....##.#..#.##..####.##.#.##.##.##...###.####..#.#.#.##.#.#.#..###..##.##.##.##.#..## +#...............##.....######.#.#####.##.#....#.#..#.##...#.##....#........##.##...#.##.##.#..#.##.# +#..##..#.#.#.##.#..#.#.##.##...#...#..#.#.##..#.#...###...##...###..#####.#.#..#..#.#..#.#.##...##.# +.#######.#.....##...#.#.####.######.#..#......#....##.#.#..#..###.#...###...#....#.#..#.##.#...#.#.. +#.###......##.#.##..#.###.###..####..##....#..###......##..##..#####.####....#...###.....###.#..#... +###...#....###.#..#.###.##...###.##.......##.##.#.#.#....####....###..##.###...#..##....#.#.##..##.. +.##.......##.######.#.#..#..##....#####.###.#.##.....####....#......####....#.##.#.##..#.##...##.#.# +.#.###...#.#.#.##.###..###...##..#.##.##..##..#.....###.#..#.##.##.####........##.#####.#.#....#...# +##...##..#.##.#######.###.#.##.#####....##.....##.#.....#.#.##.#....#.##.#....##.#..#.###..#..#.#... +.#..#.#.#.#...#.##...###.##.#.#...###.##...#.#..###....###.#.###...##..###..#..##.##....###...###.## diff --git a/2015/day19-input b/2015/day19-input new file mode 100644 index 0000000..b0515c0 --- /dev/null +++ b/2015/day19-input @@ -0,0 +1,45 @@ +Al => ThF +Al => ThRnFAr +B => BCa +B => TiB +B => TiRnFAr +Ca => CaCa +Ca => PB +Ca => PRnFAr +Ca => SiRnFYFAr +Ca => SiRnMgAr +Ca => SiTh +F => CaF +F => PMg +F => SiAl +H => CRnAlAr +H => CRnFYFYFAr +H => CRnFYMgAr +H => CRnMgYFAr +H => HCa +H => NRnFYFAr +H => NRnMgAr +H => NTh +H => OB +H => ORnFAr +Mg => BF +Mg => TiMg +N => CRnFAr +N => HSi +O => CRnFYFAr +O => CRnMgAr +O => HP +O => NRnFAr +O => OTi +P => CaP +P => PTi +P => SiRnFAr +Si => CaSi +Th => ThCa +Ti => BP +Ti => TiTi +e => HF +e => NAl +e => OMg + +CRnSiRnCaPTiMgYCaPTiRnFArSiThFArCaSiThSiThPBCaCaSiRnSiRnTiTiMgArPBCaPMgYPTiRnFArFArCaSiRnBPMgArPRnCaPTiRnFArCaSiThCaCaFArPBCaCaPTiTiRnFArCaSiRnSiAlYSiThRnFArArCaSiRnBFArCaCaSiRnSiThCaCaCaFYCaPTiBCaSiThCaSiThPMgArSiRnCaPBFYCaCaFArCaCaCaCaSiThCaSiRnPRnFArPBSiThPRnFArSiRnMgArCaFYFArCaSiRnSiAlArTiTiTiTiTiTiTiRnPMgArPTiTiTiBSiRnSiAlArTiTiRnPMgArCaFYBPBPTiRnSiRnMgArSiThCaFArCaSiThFArPRnFArCaSiRnTiBSiThSiRnSiAlYCaFArPRnFArSiThCaFArCaCaSiThCaCaCaSiRnPRnCaFArFYPMgArCaPBCaPBSiRnFYPBCaFArCaSiAl diff --git a/2015/day23-input b/2015/day23-input new file mode 100644 index 0000000..cad5dc2 --- /dev/null +++ b/2015/day23-input @@ -0,0 +1,48 @@ +jio a, +22 +inc a +tpl a +tpl a +tpl a +inc a +tpl a +inc a +tpl a +inc a +inc a +tpl a +inc a +inc a +tpl a +inc a +inc a +tpl a +inc a +inc a +tpl a +jmp +19 +tpl a +tpl a +tpl a +tpl a +inc a +inc a +tpl a +inc a +tpl a +inc a +inc a +tpl a +inc a +inc a +tpl a +inc a +tpl a +tpl a +jio a, +8 +inc b +jie a, +4 +tpl a +inc a +jmp +2 +hlf a +jmp -7 diff --git a/2015/day24-input b/2015/day24-input new file mode 100644 index 0000000..e204f7d --- /dev/null +++ b/2015/day24-input @@ -0,0 +1,28 @@ +1 +3 +5 +11 +13 +17 +19 +23 +29 +31 +37 +41 +43 +47 +53 +59 +67 +71 +73 +79 +83 +89 +97 +101 +103 +107 +109 +113 diff --git a/2015/day25-input b/2015/day25-input new file mode 100644 index 0000000..c5c38e6 --- /dev/null +++ b/2015/day25-input @@ -0,0 +1 @@ +To continue, please consult the code grid in the manual. Enter the code at row 2947, column 3029. diff --git a/2018/day10-input b/2018/day10-input new file mode 100644 index 0000000..55d6e38 --- /dev/null +++ b/2018/day10-input @@ -0,0 +1,385 @@ +position=<-52592, 31869> velocity=< 5, -3> +position=<-20934, 52988> velocity=< 2, -5> +position=<-20910, 31871> velocity=< 2, -3> +position=<-31503, -52596> velocity=< 3, 5> +position=<-42061, -10364> velocity=< 4, 1> +position=< 10776, -31475> velocity=<-1, 3> +position=<-10348, 31875> velocity=< 1, -3> +position=< 52969, 52985> velocity=<-5, -5> +position=< 31848, -10366> velocity=<-3, 1> +position=<-10376, -10366> velocity=< 1, 1> +position=<-10376, -31474> velocity=< 1, 3> +position=<-42058, 52990> velocity=< 4, -5> +position=<-52628, -10358> velocity=< 5, 1> +position=<-52630, 52985> velocity=< 5, -5> +position=< 31888, -31474> velocity=<-3, 3> +position=<-31492, 42429> velocity=< 3, -4> +position=< 31892, 52988> velocity=<-3, -5> +position=< 52961, 52989> velocity=<-5, -5> +position=<-20908, -42031> velocity=< 2, 4> +position=<-52627, 10759> velocity=< 5, -1> +position=< 21307, -42034> velocity=<-2, 4> +position=<-20937, -31475> velocity=< 2, 3> +position=< 21315, -52594> velocity=<-2, 5> +position=< 10744, -10366> velocity=<-1, 1> +position=< 21287, -10358> velocity=<-2, 1> +position=< 21298, -31478> velocity=<-2, 3> +position=<-10384, 31866> velocity=< 1, -3> +position=< 52953, -10364> velocity=<-5, 1> +position=<-42029, -52597> velocity=< 4, 5> +position=< 21319, 10757> velocity=<-2, -1> +position=<-10352, 21310> velocity=< 1, -2> +position=<-10395, -42034> velocity=< 1, 4> +position=< 10756, 31873> velocity=<-1, -3> +position=<-10384, 42425> velocity=< 1, -4> +position=<-42050, 42427> velocity=< 4, -4> +position=< 31866, 10759> velocity=<-3, -1> +position=<-52592, -10357> velocity=< 5, 1> +position=<-42066, 31874> velocity=< 4, -3> +position=<-52605, -20924> velocity=< 5, 2> +position=< 21274, 10753> velocity=<-2, -1> +position=<-20933, 42433> velocity=< 2, -4> +position=< 52961, -10365> velocity=<-5, 1> +position=<-20913, -20923> velocity=< 2, 2> +position=< 10716, -42039> velocity=<-1, 4> +position=<-42070, 21315> velocity=< 4, -2> +position=<-42040, 31875> velocity=< 4, -3> +position=<-42029, 52989> velocity=< 4, -5> +position=< 52953, -20917> velocity=<-5, 2> +position=<-42058, -10364> velocity=< 4, 1> +position=<-52574, -42031> velocity=< 5, 4> +position=<-52600, -42032> velocity=< 5, 4> +position=< 10740, -52598> velocity=<-1, 5> +position=< 42438, -20919> velocity=<-4, 2> +position=<-20937, -31477> velocity=< 2, 3> +position=<-42072, 42427> velocity=< 4, -4> +position=<-20921, -52598> velocity=< 2, 5> +position=<-52619, -20918> velocity=< 5, 2> +position=<-31467, -20915> velocity=< 3, 2> +position=<-42066, -10366> velocity=< 4, 1> +position=< 21334, -42035> velocity=<-2, 4> +position=< 21309, 21317> velocity=<-2, -2> +position=< 42414, -10364> velocity=<-4, 1> +position=< 21290, 21311> velocity=<-2, -2> +position=< 52972, -20917> velocity=<-5, 2> +position=< 10776, 10755> velocity=<-1, -1> +position=< 21298, -10363> velocity=<-2, 1> +position=< 42430, 52986> velocity=<-4, -5> +position=< 21294, 21312> velocity=<-2, -2> +position=< 10752, -10357> velocity=<-1, 1> +position=< 42438, 21315> velocity=<-4, -2> +position=<-42050, -20915> velocity=< 4, 2> +position=<-31504, -52598> velocity=< 3, 5> +position=< 52999, 21317> velocity=<-5, -2> +position=<-10390, -10362> velocity=< 1, 1> +position=< 21300, 10754> velocity=<-2, -1> +position=<-20933, -10366> velocity=< 2, 1> +position=< 10725, -10366> velocity=<-1, 1> +position=< 10737, 31874> velocity=<-1, -3> +position=<-20913, 10758> velocity=< 2, -1> +position=<-42063, 21312> velocity=< 4, -2> +position=<-10358, 10754> velocity=< 1, -1> +position=< 21334, 52986> velocity=<-2, -5> +position=< 42430, 31871> velocity=<-4, -3> +position=< 21319, 21310> velocity=<-2, -2> +position=< 21290, -52592> velocity=<-2, 5> +position=< 21295, 10753> velocity=<-2, -1> +position=< 42390, -42036> velocity=<-4, 4> +position=< 10721, 52990> velocity=<-1, -5> +position=< 21285, -52598> velocity=<-2, 5> +position=< 31837, -42037> velocity=<-3, 4> +position=<-42018, 52989> velocity=< 4, -5> +position=<-10355, 31871> velocity=< 1, -3> +position=< 42411, -31477> velocity=<-4, 3> +position=<-52632, 42428> velocity=< 5, -4> +position=< 42441, 10759> velocity=<-4, -1> +position=<-52624, -10365> velocity=< 5, 1> +position=<-10360, -42038> velocity=< 1, 4> +position=< 21314, 21311> velocity=<-2, -2> +position=< 52988, 42430> velocity=<-5, -4> +position=<-10350, -31482> velocity=< 1, 3> +position=<-52592, 10753> velocity=< 5, -1> +position=<-20954, -52590> velocity=< 2, 5> +position=<-52611, -42033> velocity=< 5, 4> +position=< 31841, 42424> velocity=<-3, -4> +position=< 10729, 52990> velocity=<-1, -5> +position=< 31837, 42426> velocity=<-3, -4> +position=<-20958, 42429> velocity=< 2, -4> +position=< 10737, 42432> velocity=<-1, -4> +position=<-52624, -31477> velocity=< 5, 3> +position=<-20949, 10754> velocity=< 2, -1> +position=< 10729, -20923> velocity=<-1, 2> +position=< 31892, -52597> velocity=<-3, 5> +position=<-10355, 21314> velocity=< 1, -2> +position=< 52960, 42428> velocity=<-5, -4> +position=<-52587, 42424> velocity=< 5, -4> +position=<-52592, 52983> velocity=< 5, -5> +position=< 31832, 21315> velocity=<-3, -2> +position=< 52956, -10362> velocity=<-5, 1> +position=< 52992, 42428> velocity=<-5, -4> +position=< 10749, -20924> velocity=<-1, 2> +position=<-31504, 21308> velocity=< 3, -2> +position=<-20950, -42032> velocity=< 2, 4> +position=<-20907, 31866> velocity=< 2, -3> +position=<-52624, 42432> velocity=< 5, -4> +position=< 31865, -10357> velocity=<-3, 1> +position=<-52611, 52988> velocity=< 5, -5> +position=< 42441, 31866> velocity=<-4, -3> +position=< 42438, 21309> velocity=<-4, -2> +position=< 42398, 21310> velocity=<-4, -2> +position=<-10352, -10360> velocity=< 1, 1> +position=<-42050, -42036> velocity=< 4, 4> +position=< 52948, 42429> velocity=<-5, -4> +position=< 52993, 21311> velocity=<-5, -2> +position=<-10384, -52598> velocity=< 1, 5> +position=<-42029, -31473> velocity=< 4, 3> +position=<-10375, -52589> velocity=< 1, 5> +position=<-31460, -31475> velocity=< 3, 3> +position=< 42418, -31473> velocity=<-4, 3> +position=<-10392, 52984> velocity=< 1, -5> +position=< 10767, 10750> velocity=<-1, -1> +position=<-52573, 52991> velocity=< 5, -5> +position=<-52611, 52984> velocity=< 5, -5> +position=<-52592, 42431> velocity=< 5, -4> +position=<-10380, 21312> velocity=< 1, -2> +position=<-42029, -42038> velocity=< 4, 4> +position=<-42056, -10362> velocity=< 4, 1> +position=<-42041, -20915> velocity=< 4, 2> +position=<-10395, 31868> velocity=< 1, -3> +position=<-42045, 52991> velocity=< 4, -5> +position=< 21319, 21313> velocity=<-2, -2> +position=< 31844, -20920> velocity=<-3, 2> +position=<-20918, 52990> velocity=< 2, -5> +position=<-31514, -52595> velocity=< 3, 5> +position=< 10752, 31869> velocity=<-1, -3> +position=<-42034, -52597> velocity=< 4, 5> +position=< 10733, -20920> velocity=<-1, 2> +position=<-31476, 21309> velocity=< 3, -2> +position=< 10716, -42037> velocity=<-1, 4> +position=< 10720, 42431> velocity=<-1, -4> +position=<-20909, -20915> velocity=< 2, 2> +position=<-52627, 10750> velocity=< 5, -1> +position=<-31489, -52589> velocity=< 3, 5> +position=< 10756, -20915> velocity=<-1, 2> +position=<-31483, -20918> velocity=< 3, 2> +position=< 31861, 10759> velocity=<-3, -1> +position=<-31471, 21308> velocity=< 3, -2> +position=< 52948, -42040> velocity=<-5, 4> +position=< 21302, -31478> velocity=<-2, 3> +position=<-52587, -31476> velocity=< 5, 3> +position=< 21308, -31477> velocity=<-2, 3> +position=<-31492, 42429> velocity=< 3, -4> +position=<-31513, -31476> velocity=< 3, 3> +position=<-10388, -52598> velocity=< 1, 5> +position=<-20953, 31867> velocity=< 2, -3> +position=<-42038, -20921> velocity=< 4, 2> +position=< 10732, 31870> velocity=<-1, -3> +position=< 52964, -52595> velocity=<-5, 5> +position=< 21284, 10750> velocity=<-2, -1> +position=< 21299, 21317> velocity=<-2, -2> +position=<-42041, 31872> velocity=< 4, -3> +position=<-10360, 10750> velocity=< 1, -1> +position=< 10774, 10759> velocity=<-1, -1> +position=< 42406, 42429> velocity=<-4, -4> +position=<-42022, 42433> velocity=< 4, -4> +position=<-52606, 42428> velocity=< 5, -4> +position=< 31832, -31476> velocity=<-3, 3> +position=< 21295, -20923> velocity=<-2, 2> +position=<-42050, -42039> velocity=< 4, 4> +position=< 21284, -52594> velocity=<-2, 5> +position=<-42034, -42035> velocity=< 4, 4> +position=< 21279, 21313> velocity=<-2, -2> +position=< 31880, 42427> velocity=<-3, -4> +position=<-31484, 21317> velocity=< 3, -2> +position=< 42391, -20922> velocity=<-4, 2> +position=<-42058, -10365> velocity=< 4, 1> +position=< 42409, 52986> velocity=<-4, -5> +position=<-20918, 42431> velocity=< 2, -4> +position=< 31851, 21312> velocity=<-3, -2> +position=<-10387, -31479> velocity=< 1, 3> +position=<-42033, -31478> velocity=< 4, 3> +position=<-42047, -42036> velocity=< 4, 4> +position=< 21301, -31482> velocity=<-2, 3> +position=<-10365, -31473> velocity=< 1, 3> +position=<-31471, -42031> velocity=< 3, 4> +position=<-42074, -10357> velocity=< 4, 1> +position=<-31500, 10758> velocity=< 3, -1> +position=< 21311, 10751> velocity=<-2, -1> +position=< 42398, -10362> velocity=<-4, 1> +position=<-20921, 42424> velocity=< 2, -4> +position=< 52985, -52597> velocity=<-5, 5> +position=<-42073, 52983> velocity=< 4, -5> +position=< 42390, 31874> velocity=<-4, -3> +position=<-42061, -10360> velocity=< 4, 1> +position=< 21301, 42428> velocity=<-2, -4> +position=<-20942, -20917> velocity=< 2, 2> +position=<-10350, -52589> velocity=< 1, 5> +position=<-52595, 31875> velocity=< 5, -3> +position=< 42432, -52594> velocity=<-4, 5> +position=<-20937, -20924> velocity=< 2, 2> +position=< 42395, 31873> velocity=<-4, -3> +position=<-31508, 42433> velocity=< 3, -4> +position=< 10751, -31473> velocity=<-1, 3> +position=<-42032, 52986> velocity=< 4, -5> +position=< 42447, -10357> velocity=<-4, 1> +position=<-42048, 42428> velocity=< 4, -4> +position=<-10344, -42032> velocity=< 1, 4> +position=< 21290, -42034> velocity=<-2, 4> +position=<-42014, -42037> velocity=< 4, 4> +position=<-20906, -42040> velocity=< 2, 4> +position=< 10721, -20920> velocity=<-1, 2> +position=<-10379, 42433> velocity=< 1, -4> +position=< 21319, 52986> velocity=<-2, -5> +position=<-10368, 42431> velocity=< 1, -4> +position=<-20950, -20924> velocity=< 2, 2> +position=< 31877, -52595> velocity=<-3, 5> +position=<-31482, 42429> velocity=< 3, -4> +position=< 21334, 42432> velocity=<-2, -4> +position=<-10364, 42427> velocity=< 1, -4> +position=<-42074, 10755> velocity=< 4, -1> +position=< 21300, -10366> velocity=<-2, 1> +position=< 42408, 10754> velocity=<-4, -1> +position=< 10732, 10753> velocity=<-1, -1> +position=<-52632, 21310> velocity=< 5, -2> +position=< 10740, -20920> velocity=<-1, 2> +position=< 52956, 42429> velocity=<-5, -4> +position=< 10756, -52598> velocity=<-1, 5> +position=<-31506, 52991> velocity=< 3, -5> +position=< 10724, 10751> velocity=<-1, -1> +position=<-20921, 21310> velocity=< 2, -2> +position=<-20946, -42031> velocity=< 2, 4> +position=< 42435, 52986> velocity=<-4, -5> +position=<-42037, -31473> velocity=< 4, 3> +position=< 21287, -52592> velocity=<-2, 5> +position=< 10717, -42039> velocity=<-1, 4> +position=<-52627, 31872> velocity=< 5, -3> +position=< 31875, 52986> velocity=<-3, -5> +position=< 42411, -42036> velocity=<-4, 4> +position=< 52964, -20915> velocity=<-5, 2> +position=<-31488, 42428> velocity=< 3, -4> +position=< 42426, 21308> velocity=<-4, -2> +position=<-52579, 10751> velocity=< 5, -1> +position=<-42014, 10753> velocity=< 4, -1> +position=<-42034, 10752> velocity=< 4, -1> +position=< 21275, 42425> velocity=<-2, -4> +position=<-10350, -10366> velocity=< 1, 1> +position=<-52628, -52591> velocity=< 5, 5> +position=< 31845, -52591> velocity=<-3, 5> +position=< 21285, -31473> velocity=<-2, 3> +position=< 21319, 21312> velocity=<-2, -2> +position=< 42427, -31480> velocity=<-4, 3> +position=< 52956, -52591> velocity=<-5, 5> +position=<-10389, 52986> velocity=< 1, -5> +position=< 42400, 10754> velocity=<-4, -1> +position=<-31508, -10362> velocity=< 3, 1> +position=< 10740, 10756> velocity=<-1, -1> +position=<-20898, 42424> velocity=< 2, -4> +position=< 21319, -42031> velocity=<-2, 4> +position=<-52574, 10759> velocity=< 5, -1> +position=< 21274, -31476> velocity=<-2, 3> +position=<-31463, -10358> velocity=< 3, 1> +position=<-20950, 21311> velocity=< 2, -2> +position=<-52600, -31474> velocity=< 5, 3> +position=< 31864, 42431> velocity=<-3, -4> +position=< 21279, 21316> velocity=<-2, -2> +position=< 21287, 42426> velocity=<-2, -4> +position=< 10716, 10754> velocity=<-1, -1> +position=<-42042, 52989> velocity=< 4, -5> +position=<-31492, 42427> velocity=< 3, -4> +position=< 21298, -10364> velocity=<-2, 1> +position=<-42040, 21308> velocity=< 4, -2> +position=<-42045, 10750> velocity=< 4, -1> +position=< 31835, -20919> velocity=<-3, 2> +position=< 10773, 42433> velocity=<-1, -4> +position=< 42443, 10758> velocity=<-4, -1> +position=< 52973, -52598> velocity=<-5, 5> +position=< 21295, -52592> velocity=<-2, 5> +position=<-10392, 31868> velocity=< 1, -3> +position=< 21282, -42031> velocity=<-2, 4> +position=< 10737, -20920> velocity=<-1, 2> +position=< 52985, 31875> velocity=<-5, -3> +position=<-42049, -20920> velocity=< 4, 2> +position=< 52992, 10754> velocity=<-5, -1> +position=< 10716, 31866> velocity=<-1, -3> +position=< 31884, -20924> velocity=<-3, 2> +position=< 42442, -20924> velocity=<-4, 2> +position=< 10732, -10361> velocity=<-1, 1> +position=<-31508, 10756> velocity=< 3, -1> +position=< 31872, 21314> velocity=<-3, -2> +position=<-42042, 10750> velocity=< 4, -1> +position=<-42069, 21315> velocity=< 4, -2> +position=<-20898, -10365> velocity=< 2, 1> +position=<-42071, -20918> velocity=< 4, 2> +position=< 10752, -10357> velocity=<-1, 1> +position=<-20946, -10362> velocity=< 2, 1> +position=<-52572, -10358> velocity=< 5, 1> +position=< 10716, 42424> velocity=<-1, -4> +position=<-52611, 42426> velocity=< 5, -4> +position=< 31856, 52991> velocity=<-3, -5> +position=< 10750, 52982> velocity=<-1, -5> +position=<-31495, -52598> velocity=< 3, 5> +position=< 52975, 21308> velocity=<-5, -2> +position=< 10729, -20919> velocity=<-1, 2> +position=<-52620, 10759> velocity=< 5, -1> +position=< 10751, -10366> velocity=<-1, 1> +position=<-20898, -52591> velocity=< 2, 5> +position=<-42023, 52991> velocity=< 4, -5> +position=<-31500, 31875> velocity=< 3, -3> +position=<-52584, 52990> velocity=< 5, -5> +position=< 21314, 52990> velocity=<-2, -5> +position=< 10776, 21309> velocity=<-1, -2> +position=<-10376, 31875> velocity=< 1, -3> +position=<-20946, -52589> velocity=< 2, 5> +position=<-52628, -52590> velocity=< 5, 5> +position=< 52988, -31474> velocity=<-5, 3> +position=<-31491, -42040> velocity=< 3, 4> +position=<-20918, -42036> velocity=< 2, 4> +position=<-20947, 10754> velocity=< 2, -1> +position=< 52953, -31474> velocity=<-5, 3> +position=<-42031, 31870> velocity=< 4, -3> +position=<-52583, 42424> velocity=< 5, -4> +position=< 42393, -20919> velocity=<-4, 2> +position=< 42411, 10750> velocity=<-4, -1> +position=< 10716, -42032> velocity=<-1, 4> +position=<-31503, 42429> velocity=< 3, -4> +position=<-42053, 10753> velocity=< 4, -1> +position=<-31481, -20920> velocity=< 3, 2> +position=<-31468, -31481> velocity=< 3, 3> +position=< 21284, -20924> velocity=<-2, 2> +position=< 42409, -42036> velocity=<-4, 4> +position=<-42063, 31875> velocity=< 4, -3> +position=< 42450, -10358> velocity=<-4, 1> +position=<-20897, -52598> velocity=< 2, 5> +position=< 42407, -10362> velocity=<-4, 1> +position=< 52983, 10754> velocity=<-5, -1> +position=< 52969, -31477> velocity=<-5, 3> +position=< 53000, -10357> velocity=<-5, 1> +position=<-52619, -31475> velocity=< 5, 3> +position=< 10756, 10756> velocity=<-1, -1> +position=< 31889, -42031> velocity=<-3, 4> +position=<-31511, 52985> velocity=< 3, -5> +position=<-31511, 42425> velocity=< 3, -4> +position=< 21322, -31476> velocity=<-2, 3> +position=< 10764, 21312> velocity=<-1, -2> +position=< 10724, 21314> velocity=<-1, -2> +position=< 53001, 10758> velocity=<-5, -1> +position=<-52607, -10362> velocity=< 5, 1> +position=<-31482, -20919> velocity=< 3, 2> +position=< 21276, 10754> velocity=<-2, -1> +position=< 42426, 21317> velocity=<-4, -2> +position=< 21299, -10362> velocity=<-2, 1> +position=< 42450, -20922> velocity=<-4, 2> +position=< 10719, 10755> velocity=<-1, -1> +position=<-52623, 10759> velocity=< 5, -1> +position=< 31840, -42040> velocity=<-3, 4> +position=< 10724, -20918> velocity=<-1, 2> +position=<-10341, 21308> velocity=< 1, -2> +position=< 42403, -10365> velocity=<-4, 1> +position=< 31877, 31866> velocity=<-3, -3> +position=<-42048, 31875> velocity=< 4, -3> +position=< 52953, 52986> velocity=<-5, -5> +position=<-10340, -10360> velocity=< 1, 1> +position=< 31869, 10752> velocity=<-3, -1> +position=<-52612, 21312> velocity=< 5, -2> +position=<-42053, -52592> velocity=< 4, 5> +position=<-31490, 10750> velocity=< 3, -1> diff --git a/2018/day10.py b/2018/day10.py new file mode 100644 index 0000000..38958fa --- /dev/null +++ b/2018/day10.py @@ -0,0 +1,53 @@ +with open('day10-input', 'r') as file: + data = [l.strip('\n') for l in file] +import numpy as np + +positions = [] +velocities = [] + +for line in data: + pos = [int(line[10:16]), -int(line[18:24])] # Invert Y for graphing purposes + vel = [int(line[36:38]), -int(line[39:42])] # Invert Y for graphing purposes + positions.append(pos) + velocities.append(vel) + +max_t = 11000 +curr_pos = np.vstack(positions) +vels = np.vstack(velocities) +positions = np.empty((385,2,max_t)) + +for t in range(max_t): + positions[:,:,t] = curr_pos + t*vels + +from pyqtgraph.Qt import QtCore, QtGui +import pyqtgraph as pg + +app = QtGui.QApplication([]) +win = pg.GraphicsLayoutWidget(show=True) +win.resize(2000,600) +win.setWindowTitle('Scatter Plot') + +p5 = win.addPlot(title="Scatter Plot") +p5.plot(positions[:,:,0], pen=None, symbol='s', symbolPen=None, symbolSize=10, symbolBrush=(100, 100, 255, 250)) + + +def mouseMoved(evt): + pos = evt[0] ## using signal proxy turns original arguments into a tuple + if p5.sceneBoundingRect().contains(pos): + x = pos.x() + # between 1000 and 1100 + x = min(x, 2000)//5 + 10300 # 10558 + + print(x) + if 0 <= x < max_t: + p5.clear() + p5.plot(positions[:, :, int(x)], pen=None, symbol='s', symbolPen=None, symbolSize=10, symbolBrush=(100, 100, 255, 250)) + +proxy = pg.SignalProxy(p5.scene().sigMouseMoved, rateLimit=60, slot=mouseMoved) + + +## Start Qt event loop unless running in interactive mode. +if __name__ == '__main__': + import sys + if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'): + QtGui.QApplication.instance().exec_()