diff --git a/2015/day6/exp b/2015/day6/exp new file mode 100644 index 0000000..e619794 --- /dev/null +++ b/2015/day6/exp @@ -0,0 +1,3 @@ +turn on 2,3 through 4,4 +turn off 1,2 through 3,2 +toggle 5,0 through 7,3 diff --git a/2021/day1/day1.sh b/2021/day1/day1.sh new file mode 100755 index 0000000..41e6cc4 --- /dev/null +++ b/2021/day1/day1.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +count=0 +grow=0 +prev=0 +while IFS= read -r line; do + echo $count $grow $prev + if [ $count -eq 0 ]; then + echo "This is the first line, we skip it (prev="$prev", line="$line")" + prev=$line + echo "prev=$prev, line=$line" + + else + if [ $line > $prev ]; then + echo $count": "$line" > "$prev + ((grov++)) + prev=$line + fi + fi + + ((count++)) +done < day1_test.txt + +echo "I can through $count lines" +echo "I found $grov depth measurement increases" diff --git a/2021/day1/day1_data.txt b/2021/day1/day1_data.txt new file mode 100644 index 0000000..3af412a --- /dev/null +++ b/2021/day1/day1_data.txt @@ -0,0 +1,2000 @@ +118 +121 +123 +125 +134 +132 +137 +135 +136 +137 +138 +139 +163 +170 +171 +159 +161 +162 +156 +155 +151 +168 +172 +166 +159 +180 +187 +172 +161 +162 +161 +183 +182 +185 +175 +173 +174 +177 +192 +191 +190 +219 +225 +226 +216 +226 +230 +234 +236 +244 +235 +245 +266 +299 +300 +281 +291 +309 +303 +333 +332 +309 +312 +313 +314 +315 +339 +351 +353 +352 +338 +343 +337 +346 +338 +335 +332 +329 +345 +347 +332 +339 +354 +373 +376 +397 +400 +401 +433 +434 +440 +434 +438 +443 +448 +452 +456 +450 +459 +463 +464 +488 +492 +488 +506 +507 +516 +523 +524 +522 +546 +551 +553 +554 +553 +562 +559 +567 +569 +556 +557 +577 +581 +582 +591 +593 +594 +595 +598 +602 +611 +623 +604 +613 +603 +607 +612 +616 +612 +613 +612 +598 +607 +622 +619 +636 +638 +639 +637 +659 +657 +677 +678 +679 +655 +651 +655 +654 +662 +666 +672 +673 +676 +683 +684 +693 +688 +691 +698 +702 +704 +706 +707 +710 +709 +725 +731 +729 +767 +779 +780 +807 +806 +808 +815 +812 +811 +819 +820 +821 +822 +826 +812 +810 +820 +817 +803 +808 +826 +831 +837 +842 +839 +840 +827 +838 +840 +841 +842 +848 +841 +838 +839 +838 +839 +841 +821 +812 +813 +796 +817 +820 +845 +854 +857 +858 +866 +869 +870 +881 +882 +888 +889 +891 +886 +891 +901 +930 +940 +944 +943 +958 +952 +916 +903 +905 +907 +910 +915 +907 +906 +907 +919 +921 +923 +925 +924 +929 +931 +936 +937 +935 +953 +962 +968 +980 +981 +1003 +1005 +1006 +1011 +1013 +1014 +1015 +1016 +1015 +995 +1002 +1018 +1020 +1031 +1043 +1038 +1039 +1040 +1041 +1043 +1037 +1041 +1050 +1052 +1048 +1049 +1050 +1053 +1057 +1064 +1067 +1068 +1078 +1086 +1098 +1103 +1119 +1138 +1114 +1115 +1129 +1130 +1143 +1138 +1141 +1150 +1153 +1146 +1155 +1157 +1145 +1146 +1147 +1145 +1144 +1158 +1163 +1167 +1171 +1174 +1176 +1188 +1207 +1205 +1208 +1212 +1216 +1222 +1231 +1233 +1249 +1253 +1269 +1231 +1235 +1242 +1241 +1246 +1247 +1263 +1266 +1259 +1260 +1279 +1280 +1281 +1285 +1284 +1285 +1296 +1300 +1302 +1319 +1312 +1313 +1325 +1342 +1344 +1361 +1349 +1363 +1367 +1366 +1346 +1347 +1369 +1385 +1386 +1397 +1401 +1402 +1396 +1397 +1400 +1395 +1400 +1411 +1419 +1427 +1446 +1445 +1459 +1460 +1464 +1472 +1482 +1474 +1475 +1476 +1481 +1484 +1487 +1494 +1497 +1494 +1495 +1498 +1501 +1511 +1521 +1528 +1533 +1535 +1544 +1518 +1521 +1509 +1533 +1537 +1540 +1545 +1546 +1544 +1564 +1553 +1576 +1577 +1563 +1560 +1564 +1569 +1570 +1571 +1573 +1576 +1573 +1596 +1597 +1593 +1597 +1596 +1592 +1597 +1578 +1555 +1576 +1584 +1585 +1584 +1594 +1598 +1608 +1613 +1614 +1606 +1608 +1621 +1648 +1614 +1615 +1606 +1609 +1610 +1625 +1638 +1640 +1617 +1655 +1661 +1644 +1648 +1649 +1653 +1675 +1674 +1681 +1679 +1682 +1683 +1695 +1696 +1699 +1700 +1701 +1704 +1709 +1729 +1732 +1739 +1742 +1746 +1748 +1746 +1753 +1744 +1752 +1749 +1750 +1758 +1762 +1767 +1771 +1772 +1761 +1763 +1784 +1804 +1809 +1792 +1787 +1806 +1809 +1815 +1817 +1828 +1821 +1824 +1823 +1824 +1841 +1840 +1833 +1840 +1842 +1863 +1862 +1865 +1866 +1868 +1878 +1887 +1897 +1905 +1906 +1913 +1908 +1915 +1930 +1928 +1922 +1925 +1927 +1928 +1939 +1938 +1946 +1947 +1954 +1955 +1959 +1961 +1951 +1945 +1949 +1954 +1959 +1961 +1962 +1964 +1960 +1956 +1958 +1975 +1990 +1994 +2002 +2004 +2011 +2010 +2020 +2042 +2043 +2046 +2047 +2044 +2048 +2065 +2074 +2075 +2086 +2088 +2094 +2098 +2092 +2083 +2082 +2084 +2094 +2097 +2099 +2098 +2101 +2104 +2112 +2118 +2105 +2108 +2109 +2104 +2105 +2103 +2114 +2144 +2138 +2139 +2142 +2114 +2120 +2139 +2147 +2153 +2190 +2191 +2197 +2193 +2206 +2216 +2225 +2230 +2232 +2258 +2264 +2236 +2264 +2289 +2306 +2307 +2315 +2319 +2322 +2277 +2279 +2271 +2279 +2285 +2290 +2297 +2316 +2317 +2320 +2329 +2330 +2323 +2326 +2327 +2331 +2336 +2341 +2348 +2352 +2386 +2396 +2401 +2400 +2401 +2418 +2419 +2429 +2432 +2430 +2428 +2406 +2401 +2434 +2435 +2443 +2463 +2478 +2479 +2481 +2482 +2486 +2490 +2491 +2492 +2496 +2497 +2499 +2507 +2525 +2522 +2523 +2522 +2521 +2526 +2531 +2530 +2525 +2526 +2537 +2533 +2534 +2542 +2544 +2531 +2539 +2546 +2550 +2551 +2553 +2554 +2552 +2562 +2566 +2551 +2583 +2587 +2601 +2605 +2604 +2610 +2628 +2639 +2641 +2654 +2657 +2676 +2672 +2686 +2694 +2677 +2693 +2694 +2707 +2696 +2710 +2753 +2752 +2722 +2723 +2724 +2741 +2746 +2753 +2763 +2764 +2805 +2806 +2810 +2811 +2823 +2854 +2855 +2852 +2872 +2873 +2867 +2876 +2881 +2885 +2899 +2900 +2901 +2903 +2918 +2912 +2924 +2915 +2920 +2932 +2942 +2943 +2934 +2953 +2960 +2956 +2957 +2959 +2982 +2991 +3016 +3018 +3047 +3032 +3048 +3051 +3056 +3063 +3064 +3063 +3065 +3066 +3070 +3075 +3069 +3075 +3073 +3074 +3083 +3086 +3097 +3093 +3082 +3077 +3098 +3105 +3128 +3144 +3148 +3174 +3173 +3172 +3171 +3169 +3176 +3180 +3166 +3165 +3182 +3183 +3206 +3207 +3208 +3211 +3215 +3214 +3220 +3233 +3234 +3248 +3249 +3252 +3253 +3254 +3256 +3258 +3266 +3265 +3266 +3274 +3291 +3275 +3291 +3294 +3299 +3292 +3293 +3306 +3292 +3291 +3290 +3291 +3295 +3296 +3288 +3294 +3305 +3308 +3315 +3319 +3327 +3332 +3334 +3332 +3342 +3346 +3347 +3348 +3360 +3370 +3371 +3373 +3379 +3387 +3386 +3389 +3393 +3398 +3405 +3406 +3413 +3417 +3431 +3433 +3434 +3438 +3442 +3443 +3445 +3446 +3447 +3448 +3454 +3439 +3450 +3451 +3453 +3452 +3455 +3462 +3466 +3475 +3479 +3476 +3479 +3480 +3484 +3486 +3489 +3491 +3505 +3506 +3510 +3513 +3530 +3532 +3537 +3540 +3542 +3553 +3558 +3570 +3569 +3570 +3569 +3570 +3565 +3559 +3561 +3556 +3557 +3575 +3585 +3590 +3592 +3593 +3602 +3619 +3623 +3624 +3669 +3671 +3672 +3683 +3686 +3699 +3708 +3709 +3714 +3713 +3718 +3719 +3742 +3729 +3730 +3731 +3729 +3727 +3741 +3742 +3741 +3742 +3734 +3740 +3744 +3734 +3737 +3738 +3739 +3759 +3760 +3761 +3750 +3751 +3753 +3745 +3744 +3731 +3733 +3725 +3750 +3757 +3767 +3768 +3774 +3777 +3791 +3815 +3816 +3817 +3819 +3820 +3825 +3835 +3836 +3858 +3861 +3860 +3844 +3846 +3847 +3877 +3906 +3910 +3912 +3940 +3941 +3975 +3980 +3983 +3987 +4016 +4028 +4047 +4066 +4061 +4058 +4061 +4066 +4088 +4089 +4092 +4098 +4105 +4110 +4111 +4103 +4108 +4082 +4087 +4086 +4087 +4082 +4083 +4084 +4104 +4110 +4111 +4119 +4128 +4133 +4113 +4129 +4128 +4129 +4121 +4123 +4126 +4132 +4133 +4143 +4149 +4148 +4147 +4145 +4142 +4143 +4146 +4138 +4139 +4141 +4147 +4148 +4160 +4156 +4162 +4173 +4179 +4181 +4190 +4191 +4190 +4191 +4192 +4193 +4194 +4208 +4211 +4215 +4226 +4223 +4227 +4230 +4250 +4248 +4267 +4260 +4274 +4275 +4278 +4291 +4298 +4304 +4314 +4315 +4317 +4319 +4325 +4326 +4327 +4349 +4345 +4356 +4360 +4365 +4366 +4370 +4385 +4384 +4386 +4399 +4423 +4397 +4410 +4409 +4388 +4393 +4397 +4402 +4403 +4418 +4413 +4418 +4417 +4418 +4422 +4411 +4374 +4403 +4412 +4427 +4445 +4449 +4453 +4458 +4459 +4465 +4447 +4448 +4450 +4460 +4464 +4465 +4467 +4472 +4486 +4484 +4482 +4507 +4512 +4525 +4524 +4525 +4527 +4522 +4521 +4524 +4550 +4551 +4552 +4550 +4554 +4555 +4586 +4578 +4582 +4594 +4588 +4592 +4595 +4598 +4599 +4614 +4615 +4623 +4632 +4633 +4655 +4661 +4662 +4690 +4689 +4690 +4694 +4704 +4705 +4694 +4697 +4702 +4703 +4704 +4703 +4709 +4714 +4722 +4728 +4741 +4761 +4767 +4768 +4770 +4775 +4778 +4770 +4788 +4789 +4802 +4805 +4808 +4811 +4819 +4812 +4813 +4821 +4838 +4839 +4843 +4817 +4821 +4824 +4820 +4843 +4845 +4849 +4852 +4872 +4873 +4870 +4885 +4902 +4920 +4921 +4923 +4936 +4930 +4932 +4933 +4931 +4949 +4974 +4976 +4977 +4978 +4990 +4991 +5001 +5002 +5001 +5027 +5026 +5021 +5054 +5055 +5056 +5059 +5064 +5065 +5074 +5081 +5093 +5095 +5100 +5113 +5125 +5126 +5137 +5142 +5123 +5118 +5117 +5118 +5125 +5135 +5142 +5154 +5165 +5158 +5146 +5148 +5149 +5163 +5176 +5177 +5169 +5171 +5168 +5186 +5191 +5196 +5197 +5224 +5226 +5224 +5215 +5213 +5214 +5198 +5201 +5202 +5213 +5214 +5216 +5251 +5255 +5259 +5262 +5259 +5261 +5264 +5273 +5281 +5254 +5265 +5280 +5289 +5294 +5298 +5309 +5310 +5298 +5297 +5306 +5311 +5301 +5306 +5289 +5287 +5300 +5299 +5301 +5308 +5314 +5323 +5329 +5330 +5324 +5325 +5332 +5335 +5332 +5333 +5334 +5337 +5345 +5351 +5355 +5364 +5366 +5382 +5391 +5408 +5400 +5402 +5405 +5390 +5391 +5394 +5407 +5409 +5410 +5411 +5412 +5416 +5412 +5424 +5426 +5425 +5426 +5434 +5421 +5433 +5440 +5441 +5435 +5424 +5417 +5413 +5414 +5415 +5418 +5420 +5421 +5444 +5442 +5433 +5435 +5436 +5437 +5407 +5406 +5424 +5427 +5433 +5434 +5438 +5441 +5443 +5444 +5445 +5446 +5453 +5464 +5465 +5478 +5474 +5462 +5463 +5491 +5498 +5499 +5500 +5501 +5504 +5506 +5530 +5524 +5517 +5521 +5530 +5532 +5538 +5544 +5541 +5554 +5556 +5553 +5554 +5556 +5562 +5563 +5568 +5572 +5584 +5581 +5584 +5582 +5586 +5588 +5599 +5602 +5603 +5601 +5610 +5607 +5602 +5604 +5600 +5602 +5605 +5606 +5608 +5606 +5610 +5619 +5620 +5619 +5623 +5624 +5626 +5627 +5628 +5630 +5637 +5650 +5674 +5677 +5661 +5669 +5675 +5676 +5681 +5685 +5687 +5709 +5713 +5714 +5724 +5728 +5729 +5727 +5741 +5755 +5741 +5730 +5724 +5727 +5726 +5730 +5731 +5732 +5734 +5733 +5734 +5735 +5736 +5737 +5736 +5730 +5732 +5742 +5744 +5747 +5755 +5760 +5755 +5757 +5768 +5793 +5798 +5799 +5805 +5808 +5810 +5812 +5814 +5815 +5817 +5850 +5851 +5839 +5860 +5870 +5871 +5879 +5886 +5897 +5904 +5908 +5907 +5911 +5910 +5914 +5916 +5917 +5919 +5917 +5928 +5930 +5931 +5932 +5941 +5944 +5946 +5951 +5931 +5905 +5930 +5936 +5937 +5935 +5936 +5942 +5944 +5951 +5916 +5899 +5892 +5891 +5902 +5907 +5951 +5952 +5957 +5958 +5961 +5965 +5969 +5974 +5975 +5953 +5956 +5965 +5985 +5987 +6017 +6016 +6017 +5990 +5991 +5999 +5993 +5995 +6016 +6017 +6014 +6049 +6042 +6053 +6055 +6068 +6069 +6074 +6072 +6079 +6074 +6076 +6066 +6065 +6067 +6098 +6104 +6116 +6115 +6113 +6099 +6100 +6101 +6100 +6111 +6115 +6140 +6106 +6107 +6117 +6131 +6135 +6144 +6118 +6113 +6118 +6128 +6129 +6135 +6138 +6143 +6144 +6142 +6144 +6145 +6144 +6147 +6151 +6149 +6150 +6151 +6135 +6136 +6132 +6118 +6113 +6120 +6117 +6118 +6122 +6125 +6126 +6124 +6131 +6132 +6135 +6136 +6154 +6160 +6167 +6179 +6181 +6186 +6196 +6225 +6228 +6232 +6221 +6238 +6249 +6252 +6254 +6256 +6260 +6269 +6271 +6263 +6272 +6271 +6272 +6271 +6285 +6308 +6319 +6327 +6334 +6337 +6356 +6385 +6380 +6387 +6395 +6396 +6392 +6395 +6398 +6400 +6401 +6396 +6399 +6400 +6380 +6379 +6380 +6377 +6397 +6398 +6396 +6415 +6419 +6438 +6449 +6465 +6459 +6461 +6463 +6466 +6492 +6493 +6502 +6501 +6503 +6510 +6511 +6512 +6505 +6506 +6508 +6525 +6523 +6530 +6536 +6535 +6539 +6544 +6545 +6534 +6532 +6537 +6542 +6543 +6544 +6545 +6559 +6560 +6577 +6578 +6580 +6581 +6582 +6591 +6597 +6581 +6595 +6608 +6620 +6624 +6632 +6636 +6639 +6637 +6645 +6648 +6650 +6651 +6645 +6648 +6661 +6658 +6659 +6668 +6667 +6666 +6684 +6700 +6701 +6730 +6736 +6746 +6749 +6750 +6751 +6741 +6728 +6729 +6762 +6763 +6792 +6795 +6796 +6813 +6827 +6835 +6843 +6844 +6852 +6854 +6856 +6868 +6870 +6876 +6874 +6865 +6870 +6867 +6870 +6877 +6887 +6881 +6869 +6871 +6874 +6875 +6876 +6902 +6903 +6901 +6902 +6912 +6913 +6912 +6913 +6927 +6928 +6935 +6936 +6942 +6943 +6942 +6943 +6953 +6954 +6961 +6989 +6992 +6993 +6997 +7018 +7022 +7041 +7052 +7055 +7058 +7049 +7050 +7051 +7047 +7064 +7059 +7074 +7082 +7083 +7097 +7102 +7092 +7094 +7101 +7143 +7165 +7176 +7178 +7183 +7180 +7203 +7204 +7207 +7211 +7217 +7220 +7212 +7215 +7217 +7223 +7207 +7214 +7213 +7215 +7214 +7212 +7219 +7226 +7225 +7230 +7239 +7240 +7241 +7248 +7247 +7254 +7258 +7262 +7280 +7298 +7297 +7307 +7308 +7316 +7314 +7339 +7340 +7359 +7356 +7383 +7382 +7385 +7397 +7399 +7410 +7437 +7440 +7439 +7457 +7455 +7462 +7463 +7464 +7465 +7477 +7478 +7494 +7500 +7507 +7512 +7547 +7558 +7559 +7571 +7572 +7575 +7608 +7633 +7636 +7629 +7628 +7633 +7635 +7641 +7659 +7663 +7677 +7694 +7708 +7701 +7697 +7682 +7684 +7675 +7664 +7672 +7675 +7669 +7671 +7672 +7684 +7688 +7701 +7712 +7741 +7727 +7733 +7735 +7736 +7737 +7744 +7748 +7749 +7750 +7736 +7737 +7752 +7755 +7756 +7757 +7791 +7790 +7785 +7791 +7812 +7825 +7816 +7819 +7824 +7829 +7855 +7846 +7854 +7827 +7831 +7835 +7836 +7845 +7848 +7861 +7862 +7864 +7847 +7858 +7877 +7878 +7888 +7885 +7881 +7878 +7883 +7884 +7882 +7883 +7901 +7916 +7922 +7909 +7915 +7929 +7942 +7953 +7954 +7951 +7967 +7963 diff --git a/2021/day1/day1_test.txt b/2021/day1/day1_test.txt new file mode 100644 index 0000000..7644f55 --- /dev/null +++ b/2021/day1/day1_test.txt @@ -0,0 +1,10 @@ +199 +200 +208 +210 +200 +207 +240 +269 +260 +263 \ No newline at end of file diff --git a/2021/day2/day2_data.txt b/2021/day2/day2_data.txt new file mode 100644 index 0000000..64f1ce2 --- /dev/null +++ b/2021/day2/day2_data.txt @@ -0,0 +1,1000 @@ +forward 1 +down 9 +down 4 +forward 4 +down 2 +down 7 +up 9 +down 5 +forward 9 +forward 9 +down 2 +forward 7 +forward 9 +down 5 +down 2 +up 9 +down 7 +forward 6 +down 6 +down 6 +up 1 +down 2 +forward 8 +forward 8 +forward 9 +up 1 +forward 4 +up 1 +forward 3 +forward 5 +up 3 +up 7 +down 4 +down 1 +forward 3 +forward 4 +up 3 +forward 9 +down 2 +forward 5 +up 2 +up 1 +up 5 +forward 1 +up 9 +forward 6 +up 4 +down 4 +forward 3 +up 7 +down 1 +down 1 +down 8 +forward 3 +forward 1 +up 7 +up 1 +down 4 +up 6 +down 6 +forward 8 +down 3 +down 9 +down 6 +up 8 +forward 8 +down 9 +up 7 +down 7 +forward 8 +down 8 +up 6 +down 7 +down 4 +up 7 +forward 7 +forward 7 +forward 2 +forward 5 +down 5 +down 9 +down 8 +down 5 +up 3 +down 3 +down 6 +down 6 +forward 1 +down 2 +forward 2 +down 5 +up 2 +forward 5 +down 1 +down 3 +forward 4 +down 2 +forward 8 +down 6 +forward 3 +forward 3 +forward 9 +down 9 +down 4 +down 8 +down 7 +down 3 +up 6 +down 7 +forward 9 +up 9 +down 8 +forward 9 +forward 8 +down 2 +up 4 +forward 8 +up 7 +down 2 +forward 6 +forward 7 +down 5 +up 4 +down 3 +down 3 +down 5 +down 2 +down 5 +forward 8 +forward 8 +down 5 +up 4 +down 6 +forward 5 +up 6 +up 5 +down 4 +forward 7 +forward 5 +down 7 +up 9 +up 4 +up 9 +forward 8 +down 8 +down 8 +down 2 +down 8 +down 8 +up 6 +forward 2 +down 9 +forward 5 +forward 4 +down 8 +up 5 +forward 3 +forward 1 +down 6 +forward 9 +forward 2 +forward 1 +up 5 +down 2 +forward 5 +up 6 +up 6 +forward 9 +up 3 +forward 2 +forward 9 +down 9 +down 5 +up 4 +up 7 +up 8 +forward 4 +forward 3 +down 7 +down 5 +forward 5 +down 6 +forward 9 +up 4 +up 6 +down 2 +forward 6 +forward 7 +up 9 +up 5 +down 4 +up 5 +down 2 +forward 4 +up 9 +down 1 +forward 7 +down 9 +forward 5 +down 5 +down 2 +up 4 +up 8 +down 8 +down 7 +up 7 +down 1 +forward 5 +forward 8 +down 2 +down 1 +forward 8 +down 7 +up 6 +forward 9 +forward 4 +down 8 +forward 1 +up 8 +forward 3 +up 4 +forward 9 +down 6 +forward 5 +forward 1 +forward 8 +forward 5 +forward 8 +down 4 +forward 8 +forward 2 +forward 8 +forward 3 +down 3 +forward 6 +up 6 +up 9 +down 4 +down 6 +forward 6 +down 9 +up 2 +down 8 +down 6 +down 1 +forward 1 +down 2 +down 3 +forward 5 +forward 6 +down 5 +up 7 +up 2 +forward 2 +down 4 +down 4 +forward 3 +down 4 +up 4 +forward 1 +down 4 +forward 9 +forward 7 +forward 6 +down 3 +down 4 +forward 3 +forward 3 +forward 3 +up 6 +forward 4 +forward 7 +forward 3 +forward 5 +forward 7 +forward 4 +down 1 +up 2 +up 7 +forward 4 +down 2 +forward 2 +up 7 +down 7 +forward 5 +forward 9 +down 8 +forward 5 +forward 5 +down 9 +forward 1 +forward 6 +down 2 +down 3 +down 1 +down 7 +down 3 +up 3 +down 3 +forward 5 +down 4 +forward 6 +forward 2 +down 4 +forward 4 +up 5 +up 3 +forward 2 +forward 5 +down 7 +up 9 +up 5 +down 3 +forward 8 +forward 4 +down 8 +up 4 +forward 8 +forward 7 +forward 1 +down 2 +down 6 +up 7 +forward 9 +down 2 +down 4 +down 3 +down 8 +up 4 +down 2 +up 3 +forward 1 +down 2 +up 6 +down 9 +up 3 +down 1 +down 1 +forward 4 +down 2 +forward 3 +forward 5 +forward 7 +down 7 +up 3 +up 5 +down 1 +down 2 +forward 4 +down 1 +down 1 +down 7 +up 4 +forward 3 +down 3 +forward 2 +down 3 +up 7 +down 1 +up 5 +down 7 +forward 4 +up 2 +forward 5 +up 4 +down 4 +down 3 +forward 1 +up 9 +down 5 +forward 9 +forward 1 +down 7 +down 2 +down 4 +down 2 +forward 3 +down 1 +down 2 +up 9 +forward 2 +down 8 +forward 1 +forward 3 +down 5 +down 4 +forward 2 +forward 8 +forward 9 +down 9 +down 6 +up 3 +forward 1 +down 6 +down 7 +up 3 +forward 9 +down 2 +up 4 +forward 3 +forward 6 +forward 6 +down 7 +forward 7 +forward 6 +down 7 +up 9 +forward 7 +down 1 +down 8 +down 2 +down 2 +down 9 +down 6 +forward 1 +down 9 +forward 9 +forward 8 +forward 6 +forward 9 +down 5 +forward 9 +forward 4 +forward 4 +down 6 +forward 6 +forward 5 +forward 7 +down 7 +down 9 +forward 4 +down 9 +up 5 +forward 6 +down 6 +forward 9 +up 7 +forward 6 +up 6 +up 9 +forward 9 +up 4 +down 3 +up 9 +down 8 +down 2 +forward 4 +down 8 +down 2 +forward 2 +down 5 +up 3 +down 1 +forward 4 +down 3 +forward 3 +down 9 +forward 6 +forward 6 +down 9 +forward 6 +forward 1 +down 5 +up 1 +forward 3 +forward 1 +forward 5 +down 8 +forward 7 +forward 2 +up 3 +forward 8 +forward 1 +forward 7 +down 1 +down 4 +forward 7 +forward 9 +forward 4 +down 2 +forward 5 +forward 3 +forward 9 +forward 3 +up 3 +forward 9 +down 3 +forward 9 +forward 3 +forward 7 +down 5 +forward 6 +down 6 +forward 5 +forward 1 +down 1 +forward 8 +down 3 +up 1 +down 6 +forward 7 +up 5 +up 7 +down 3 +forward 8 +up 8 +down 4 +up 6 +up 7 +forward 1 +forward 2 +forward 7 +down 1 +forward 4 +down 8 +up 6 +up 7 +up 4 +down 7 +down 8 +down 6 +forward 5 +forward 9 +down 7 +forward 8 +down 9 +down 9 +forward 5 +forward 2 +up 4 +down 2 +forward 3 +down 2 +forward 1 +down 7 +down 6 +forward 5 +up 2 +forward 4 +down 4 +forward 5 +forward 7 +up 5 +down 7 +forward 9 +forward 3 +forward 6 +up 8 +down 9 +forward 1 +up 8 +forward 3 +down 6 +down 1 +down 3 +down 4 +up 2 +up 3 +forward 8 +up 7 +down 2 +forward 1 +down 6 +forward 1 +down 8 +forward 3 +forward 5 +forward 5 +up 5 +forward 4 +forward 6 +down 8 +up 7 +forward 8 +up 6 +forward 5 +down 4 +forward 8 +down 3 +forward 7 +forward 9 +forward 8 +up 9 +forward 4 +up 5 +up 8 +down 8 +forward 1 +down 1 +forward 3 +forward 9 +down 9 +up 2 +forward 5 +down 1 +down 6 +forward 2 +forward 2 +down 2 +down 8 +forward 5 +up 2 +up 2 +forward 3 +down 6 +up 2 +down 2 +down 1 +up 9 +forward 6 +up 4 +forward 4 +down 2 +forward 8 +up 9 +down 1 +forward 9 +up 3 +up 7 +forward 5 +down 9 +down 2 +down 5 +up 4 +up 8 +up 2 +down 1 +up 4 +forward 8 +forward 2 +down 8 +forward 9 +forward 1 +down 5 +forward 3 +down 6 +forward 3 +up 2 +down 9 +down 6 +down 4 +down 9 +down 8 +forward 2 +forward 7 +up 4 +forward 8 +up 9 +up 6 +forward 2 +down 1 +down 5 +down 5 +down 3 +up 9 +up 9 +forward 9 +forward 5 +down 1 +down 3 +down 8 +down 4 +forward 5 +up 4 +down 2 +down 5 +down 4 +down 8 +down 2 +forward 9 +forward 7 +up 9 +forward 8 +down 9 +down 2 +forward 5 +down 9 +forward 7 +down 2 +down 9 +forward 4 +up 7 +down 9 +forward 6 +forward 2 +down 1 +down 9 +down 3 +down 7 +down 8 +down 5 +down 9 +down 1 +up 9 +down 7 +forward 7 +up 4 +down 2 +down 4 +forward 6 +forward 8 +forward 1 +forward 2 +up 2 +up 2 +forward 9 +down 9 +forward 8 +forward 6 +forward 5 +down 2 +forward 7 +up 3 +up 8 +forward 1 +forward 5 +down 7 +down 7 +forward 5 +down 1 +up 3 +up 8 +forward 5 +forward 7 +forward 3 +down 6 +up 7 +forward 8 +down 5 +up 3 +forward 7 +down 2 +down 1 +down 1 +forward 1 +down 1 +down 8 +down 3 +up 1 +forward 8 +forward 9 +forward 5 +forward 8 +down 2 +forward 3 +down 5 +up 9 +down 9 +down 5 +forward 1 +up 9 +up 4 +up 7 +up 9 +up 4 +down 2 +forward 6 +forward 4 +up 5 +up 6 +down 8 +down 6 +down 6 +up 3 +forward 3 +down 9 +down 5 +down 5 +forward 7 +down 6 +forward 7 +down 9 +down 8 +down 3 +down 7 +down 4 +down 1 +forward 6 +up 7 +down 1 +forward 7 +down 2 +forward 4 +down 3 +forward 6 +up 7 +forward 3 +down 3 +up 6 +down 2 +down 4 +down 8 +forward 6 +down 4 +forward 7 +down 2 +forward 9 +down 3 +down 6 +down 3 +down 6 +forward 4 +down 8 +up 5 +down 6 +forward 6 +down 6 +forward 9 +up 8 +down 7 +up 1 +forward 4 +up 3 +forward 9 +up 6 +forward 4 +up 8 +forward 2 +down 7 +down 7 +forward 1 +up 9 +up 7 +forward 3 +down 1 +up 5 +forward 3 +forward 1 +forward 3 +forward 7 +down 6 +down 1 +forward 9 +up 1 +up 1 +down 8 +down 7 +forward 1 +up 8 +up 6 +down 8 +forward 1 +up 3 +down 7 +forward 7 +down 7 +forward 4 +forward 6 +up 2 +down 9 +forward 9 +down 4 +up 2 +forward 7 +forward 4 +up 8 +up 5 +down 8 +forward 7 +forward 6 +down 1 +up 5 +up 5 +down 3 +forward 7 +forward 1 +forward 7 +forward 1 +down 3 +forward 3 +forward 4 +forward 6 +down 3 +up 4 +up 5 +down 8 +up 3 +forward 4 +forward 6 +forward 8 +forward 4 +forward 7 +down 9 +up 3 +down 1 +up 4 +forward 8 +forward 5 +forward 4 +forward 1 +down 2 +down 7 +down 6 +forward 4 +forward 2 +up 2 +down 2 +forward 2 +forward 2 +up 6 +forward 6 +forward 1 +forward 8 +up 7 +forward 4 +forward 2 +down 2 +down 1 +forward 4 +down 4 +up 7 +up 2 +up 3 +down 5 +forward 2 +forward 9 +down 2 +down 9 +down 4 +down 8 +up 9 +up 5 +up 2 +forward 6 +down 6 +forward 9 +forward 7 +forward 8 +forward 4 +up 9 +forward 9 +down 8 +down 2 +forward 5 +down 8 +down 8 +forward 8 +forward 6 +forward 7 +down 8 +forward 1 +forward 6 +down 4 +forward 1 +down 3 +forward 1 +down 8 +forward 2 +down 4 +down 6 +down 4 +up 9 +forward 6 +up 3 +down 7 +forward 3 +down 8 +forward 6 +forward 3 +down 1 +forward 1 +up 6 +down 1 +down 2 +forward 5 +down 3 +up 5 +forward 6 +forward 7 +forward 2 +forward 9 +down 7 +up 4 +forward 6 +forward 8 +down 6 +down 7 +down 4 +down 5 +down 6 +down 3 +up 1 +forward 2 +forward 3 +down 1 +down 7 +up 8 +forward 1 +forward 6 +up 3 +down 1 +up 6 +down 2 +up 1 +up 7 +forward 3 +up 8 +forward 7 +forward 5 +forward 5 diff --git a/2021/day2/day2_test.txt b/2021/day2/day2_test.txt new file mode 100644 index 0000000..4b801ad --- /dev/null +++ b/2021/day2/day2_test.txt @@ -0,0 +1,6 @@ +forward 5 +down 5 +forward 8 +up 3 +down 8 +forward 2 diff --git a/2021/day3/day3_data.txt b/2021/day3/day3_data.txt new file mode 100644 index 0000000..7320494 --- /dev/null +++ b/2021/day3/day3_data.txt @@ -0,0 +1,1000 @@ +111100000101 +001110100010 +101110110011 +100000001101 +001101010011 +101111110000 +011101110001 +000000010111 +011011000010 +110110010000 +011101000000 +110010001001 +101110100111 +001001101111 +101001011010 +101001000001 +101110111101 +010100101100 +001000110010 +010100011110 +100100000001 +000110011000 +110100100001 +111000110000 +000111100100 +101100110100 +101111101001 +101110101001 +010010110001 +000111100001 +001100001000 +100011101001 +100010111000 +000001011000 +001011110100 +011110010001 +110000011010 +100011011111 +001001110101 +001010000101 +100000010010 +000011100010 +101010110101 +001110000101 +000111101101 +010100101010 +101111101011 +010001100000 +110101100010 +001001001111 +001101011010 +111010010101 +110001000011 +000011110100 +100010111101 +111100101110 +110110001101 +001000011011 +101110101110 +111011101110 +010000110001 +101111011111 +000001001110 +111101100011 +000100000000 +100001001111 +110010000010 +101111010011 +010000101000 +011010101111 +110101101100 +101101011100 +100101111101 +011101011110 +111001001000 +100111001101 +101101000100 +110111111010 +011001101001 +111101010110 +001111001110 +111100010111 +000100111100 +011100101001 +111100111100 +101000011100 +011100111100 +011010110010 +101111101101 +010111101010 +001011000111 +000010011111 +101000100110 +000100110101 +100101001100 +010100110110 +011111100110 +000000101011 +111111101110 +001011101101 +000010001101 +001100100100 +101010010111 +100010011001 +010100000110 +010000001101 +010001101011 +000111111001 +101110010010 +011100101000 +010101010001 +111011110111 +000010110001 +101111000111 +001101110000 +111111011011 +100010011010 +001011011010 +110111001001 +110101110100 +101100111100 +011110101010 +010000001010 +001111100001 +000110000110 +111010111010 +101110100100 +000001110010 +110111001101 +000001101000 +000010001111 +110000100011 +000000001001 +000111111110 +111101111010 +010110101010 +110101011111 +000111000110 +111001100001 +101111100000 +011011010111 +101011010111 +110011101111 +001110001111 +010001100100 +111001010000 +100111000100 +110101010100 +000011111101 +100010010000 +110110100100 +100111011110 +101011001101 +111011100110 +100000010000 +110000001111 +001000000111 +111011011011 +101111101000 +001110001010 +100110000000 +110001100110 +011110100010 +000001010110 +010100000101 +101010101010 +001101000110 +110100001111 +110000001101 +101101000000 +101101101011 +111001100101 +101010001111 +101101001101 +010111101011 +101000101101 +001010000111 +011110111001 +001011101000 +101101000010 +110111111110 +110001011011 +101111101100 +101110110101 +101100111101 +001110001101 +010111000110 +110101110110 +101001101001 +010100001000 +011011111110 +111010010001 +101110100000 +000101111100 +001111110111 +001010110011 +010011011001 +101111100001 +100101111110 +010001010011 +001101110001 +011100001000 +101100000101 +000111111101 +010101110000 +100110001100 +010101111100 +100101110100 +110111000001 +101110101000 +000011010000 +101011110101 +100011110100 +111100010110 +110100011001 +001001001100 +010110111000 +001000101111 +111101001110 +011110000011 +000111000100 +001101110101 +110111011101 +100000111001 +100000001001 +110110111011 +010011000110 +000100010101 +100101010001 +100100101100 +010001001100 +000010001010 +101100101101 +011011101111 +100010111011 +111111101111 +110001100001 +101011101111 +000100011101 +111000010001 +000001011001 +001101111101 +001000000001 +010100010100 +110010111011 +010100100011 +001010001010 +111111011010 +100101010101 +000111000010 +011010100000 +010100111111 +001011100010 +101010001011 +111011010101 +100100100111 +101110101010 +111100101001 +111010001000 +000100001111 +011010001000 +011011100100 +110011011111 +110111100010 +000100001100 +001001101101 +110111110011 +101111001001 +101010001001 +011011000111 +000110001001 +111011001010 +000110000100 +000000111011 +010110110110 +101000000000 +011100101111 +111101111000 +001110011100 +111110011001 +000010111000 +010111001100 +010010111111 +110101100111 +000110111010 +000001111110 +111000000000 +001110011101 +100000111100 +100010100001 +010011101100 +010001101010 +001001101011 +110100010100 +011000000110 +011000011001 +010001101111 +000101001111 +011101111101 +100010010011 +100101111000 +001101110111 +001000000000 +100100101011 +111000100011 +101100011011 +000000101101 +001110010011 +001010010000 +011000001110 +101011111001 +110101100000 +011011111010 +001000011111 +011000100000 +000010101100 +111100010011 +101010000011 +001100111111 +000001111000 +111101110101 +001010100111 +011100111111 +111010111000 +100101011111 +011100001101 +001011000011 +110001110110 +000011101000 +111110010111 +100010101101 +110001011101 +011010100010 +001110000011 +101001101111 +100110100100 +011010000111 +001111010011 +110111101111 +110101100101 +100011010000 +011110000100 +010110100010 +011000111001 +011111011010 +011110110101 +011011110111 +001111100101 +101110100110 +101010100000 +110100001100 +111010110101 +011010001111 +000010111110 +100110010111 +011100011011 +100101100011 +010110111100 +010011110111 +111001011101 +000011111100 +000111111111 +101000111010 +010110110011 +100110101111 +100010111010 +111001111111 +000110110011 +010010111101 +110001100011 +111100001000 +010011000011 +011011101011 +001010101101 +100011010011 +001100101110 +111000111111 +101001011101 +111011010011 +110101011101 +001011010111 +011001010100 +010011010100 +011100100110 +101111110001 +110111111101 +111110100110 +110001100000 +010110010011 +011100110001 +010111111011 +001010101000 +010100101111 +111101000001 +100000111010 +001010100000 +000001011011 +100111011101 +100011110010 +011111010000 +111001010110 +110111111100 +010110100011 +101111111010 +110111110000 +111100000110 +111101011110 +100101111100 +111110001101 +111110011110 +010101100010 +110101101101 +111100001101 +000100011100 +010011110011 +000100010100 +000110110010 +001010111000 +110111001111 +110101000101 +100011110000 +101010010010 +111110000010 +111011001011 +010110111010 +011101010100 +010010101010 +010011110001 +010000010110 +101111000011 +111111010100 +001111001001 +101001100111 +000011011111 +100111000001 +010111010110 +010100011100 +010100011101 +001111110011 +101100010111 +101110100010 +111101110100 +100100100010 +111010011011 +010110000100 +100100010100 +101000011010 +101001111101 +010000010001 +110111101101 +000001110110 +010001110100 +100100110001 +011111010111 +100000000110 +100001110110 +000001011110 +011000001100 +011001110110 +010010101110 +111100111000 +001010010011 +000001000001 +100010111001 +010001011111 +001110000000 +000010000000 +001101110011 +010100011001 +000001001010 +110001000110 +100010100101 +011100010001 +101100000110 +001001100000 +110100000000 +000010100010 +101101100111 +100001111011 +011000011101 +110100110010 +001011001101 +000111001110 +011100100100 +100010000100 +001101100000 +100010011111 +010101010111 +000101010011 +100011100000 +100001011101 +110011111100 +111010011001 +001011110111 +011010010100 +000011001110 +010110111001 +111000001001 +011100111010 +011111000010 +101100111010 +010100111101 +111001100100 +101111010110 +110111110100 +111110101010 +010011001110 +110101101001 +111101011000 +001010001101 +101111000010 +111110000111 +110000001100 +011111001101 +101001000101 +010111001011 +001010011110 +111010100100 +110000101000 +011101000011 +010010100110 +111010000001 +111101000111 +001010100101 +101011001100 +110010111001 +111000111100 +100101011101 +110010101001 +010010111000 +010101001110 +110000101111 +001101001101 +001000101011 +001110110111 +101111111011 +111001100110 +100101110000 +010000011011 +001010000000 +011001010110 +010101101010 +100100000011 +110010101110 +110011101000 +001010001000 +010000101100 +100110011110 +001010001111 +111010001101 +100100010000 +100100111001 +111111010110 +100010011101 +110100100100 +000110011101 +000101101001 +001011001100 +101000000001 +111101100000 +110110111000 +111111000010 +001010111011 +011011111000 +010111000101 +011100110011 +111111100010 +000000100010 +001000011110 +010001011001 +111100111101 +001111010010 +010110011011 +111110001110 +101111100100 +011100011101 +111001111001 +101001000100 +001011000110 +100011010101 +001101100010 +110111101110 +010101111000 +111010000111 +000110010111 +001100111101 +100000101101 +000110101000 +011000011100 +000101001110 +011010101100 +100010010100 +001001111001 +101100100000 +010011011000 +100110101011 +110111110110 +100111001100 +111010010011 +000100011110 +011100011000 +010000011001 +100110011010 +010000001000 +101010011010 +111111011100 +010110100111 +000110001101 +001011111000 +011010111001 +111011011101 +110000010110 +100110111001 +110010000001 +110001011110 +111100001010 +101110111100 +110011110100 +101111011101 +000101010010 +001111000110 +110010011010 +000010010001 +001110110110 +111101100101 +000000111101 +011110000110 +111011001101 +110111000110 +101100110101 +010001001001 +001010110101 +101100011010 +100011001010 +001011101110 +101000010110 +100100111011 +001011101100 +111110111010 +110011111010 +000001111101 +010000110111 +101101101100 +000110000000 +111110110100 +101100000010 +011000000001 +001000001001 +111101111011 +010100001110 +111100101000 +011000010111 +001000111101 +100000100101 +110111000101 +001111100000 +101110111001 +000100101111 +101011010100 +101111111001 +000010000101 +001100001111 +101001011001 +001110111000 +010011011101 +110110111001 +011111010010 +100111101011 +101110011000 +010011100110 +101111000000 +101000110111 +001100000111 +110001101111 +010011101010 +100100000111 +100011111101 +010111010010 +001010111010 +011111010110 +101101100101 +011110001000 +000100111111 +001010111100 +101101100000 +010010000011 +010011010111 +111000011110 +110111010101 +100100101000 +101001001000 +001111110100 +111011110101 +110001000100 +100111111001 +101010110100 +010111101001 +011011010010 +011111101010 +111100111110 +110011101101 +110110101101 +110010100101 +111110101111 +000011110011 +001100001011 +111110110111 +011011101100 +110111101011 +010111010000 +101000010111 +010100010001 +111101100100 +011101101010 +010000110110 +111001110000 +111111000100 +011001100000 +111100101111 +011001001011 +110100100011 +011001111000 +101010001100 +100010001110 +010111110110 +001011011111 +000001011100 +010010001111 +011101011000 +001010011010 +100010011110 +010011000111 +101011011111 +100101000010 +110111010111 +110111101010 +010100001011 +001001010011 +001011001111 +011000001111 +010100000111 +100011001111 +110100111100 +101110010000 +000010110010 +100010100010 +001010011000 +010101100101 +101100010001 +011011001010 +000101100000 +000101111010 +001001110010 +100011100001 +011110111011 +100000010111 +100001001101 +111000100010 +011000011000 +100001100010 +000000110011 +000101010111 +000101000100 +110111000111 +001100000000 +110100010110 +101001000011 +110111100100 +000111100011 +101110001001 +000010011101 +000011010111 +111101011001 +111010001111 +000100110100 +000011100001 +100100111000 +100111101110 +001110101011 +000111110100 +110000010111 +110010011111 +000001111111 +101011110011 +101100001101 +110101111011 +011111000111 +011110011011 +001000010110 +110110110100 +010101001011 +000100111000 +011101111111 +000111101001 +110101111010 +110000111001 +011000111101 +001101001010 +110100110100 +100110010001 +100000000100 +001100111000 +100000001110 +101000011000 +100010110110 +101011001001 +010010001010 +111011101100 +100010100110 +101101000111 +100110110101 +111001010100 +101000110000 +000101011010 +010001010110 +010111011110 +001101011110 +000100000101 +000001011101 +010010100000 +110110010001 +100111000111 +100010110000 +010110100000 +110111111111 +011111011111 +001011010010 +001111100011 +100010110100 +011010001011 +110011001010 +101110111000 +111001010011 +010011010101 +011100100101 +101010110011 +001001100101 +110010100000 +011000111110 +011101001110 +110110000100 +001111101100 +101100010100 +110001100101 +111111010001 +011001100001 +110100000101 +000000010000 +110101000111 +100100110100 +010010110100 +010010000100 +011000111111 +011001101010 +011111101110 +110110010100 +110001001110 +111111100011 +010001100001 +001001111011 +000101110010 +011111110111 +000011000110 +110101000001 +101110000011 +000000111010 +000101110011 +000011100111 +010010010011 +110011011010 +111100100100 +110010011101 +100001001000 +101000110001 +101001010011 +111000111101 +101011111000 +110011110110 +111110100011 +010110100100 +010101000011 +001010101100 +101010101001 +111100100000 +001111011111 +110101010011 +101111010000 +110011110010 +110110110001 +011010011110 +100010010101 +101000101010 +010111010001 +000001111100 +001000011001 +011110110001 +110100011000 +110000111110 +001001011100 +110110110101 +011011100110 +011110010100 +111011110110 +111110111001 +111010010100 +001000001011 +111101010011 +100111101010 +010100001100 +111101111111 +000111111000 +001010011101 +100000001011 +010010001110 +011011011101 +100000000111 +100101100100 +001110000010 +000000000000 +101000110100 +011010110001 +100001101110 +110001110011 +101100010000 +001111111111 +111110110101 +010111001101 +011001000001 +111110011100 +100100011010 +001000011000 +011101101100 +100110111111 +111011011010 +101001101000 +010011110000 +110010110011 +111000000001 +101101110110 +111000001101 +011111001001 +010010110101 +001100010101 +111011110010 +100011000101 +111010000100 +011001111101 +111010011110 +111011111011 +110110011010 +011111011011 +010010001100 +110100111110 +010100111011 +110110011101 +110011010000 +110001001010 +000011000111 +100011101101 +101010100010 +110111001010 +100101101110 +111100101010 +110001011001 +011010011001 +000001111010 +001010101010 +010001110000 +001001111100 +011110000010 +000100010001 +110100000110 +010110111011 +001100111100 +111100011000 +011011011010 +111001001010 +110110100111 +001011000000 +000001110001 +101100011100 +100011000011 +001100010001 +000100111011 +001001110011 +100111111100 +111010001001 +101001000110 +001101000100 +110000000100 +111010110011 +000101110000 +010000010101 +000110111001 +100100100000 +110010001011 +110111100011 +101101101001 +100001100100 +000111010100 diff --git a/2021/day3/day3_test.txt b/2021/day3/day3_test.txt new file mode 100644 index 0000000..a6366a8 --- /dev/null +++ b/2021/day3/day3_test.txt @@ -0,0 +1,12 @@ +00100 +11110 +10110 +10111 +10101 +01111 +00111 +11100 +10000 +11001 +00010 +01010 diff --git a/2021/day4/day4_part2.py b/2021/day4/day4_part2.py new file mode 100644 index 0000000..679fabd --- /dev/null +++ b/2021/day4/day4_part2.py @@ -0,0 +1,87 @@ +import numpy as np +import re, sys + +filename = open(sys.argv[1],"r") +x = [] +xr = filename.readlines()[0].strip() + +#print(filename.readline().rstrip()) + +#for i in filename.readlines(): +# print (i.strip()) + + + + +llist=[] + +bingo_numbers=[] +with open(sys.argv[1]) as f: +# x = [ j for j in x.split() ] + + #lines = f.readlines() + #lines = [line.rstrip() for line in lines] + for line in f: + if re.search("^[0-9]+,",line.rstrip()): + bingo_numbers = [int(i) for i in line.rstrip().split(',')] + else: + for x in line.rstrip().split(' '): + if x != '': + llist.append(x) + +plates = len(llist)/25 +numbers=np.zeros((int(plates),5,5)) +bingo=np.zeros((int(plates),5,5)) +for l in range(0,int(plates)): + for i in range(0,5): + for j in range(0,5): + numbers[l][i][j]=llist[0] + llist.pop(0) + #print() + #print() +print("----") +print(bingo_numbers) + +force_break = False +called_numbers = [] +winner = [] +already_called = [] +for k in range(0,len(bingo_numbers)): + for l in range(0,int(plates)): + if l not in already_called: + print('-----') + print (l) + print (already_called) + print('>><<') + if len(already_called) == int(plates)-1: + force_break = True + print('LAST IS NR ' + str(l)) + called_numbers.append(bingo_numbers[0]) + bingo_numbers.pop(0) + break + for i in range(0,5): + for j in range(0,5): + if numbers[l][i][j] == bingo_numbers[0]: + bingo[l][i][j] = 1 + if sum(bingo[l][i]) == 5: + winner = numbers[l] + already_called.append(l) + #print(numbers[l]) + #force_break = True + #break + if force_break: + break + + +print(called_numbers) +print(winner) + +winner_sum = 0 + +for i in winner: + for j in i: + if int(j) not in called_numbers: + winner_sum += int(j) + +print(winner_sum*called_numbers[-1]) + diff --git a/2021/day4/test_input b/2021/day4/test_input new file mode 100644 index 0000000..669a51d --- /dev/null +++ b/2021/day4/test_input @@ -0,0 +1,19 @@ +7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1 + +22 13 17 11 0 + 8 2 23 4 24 +21 9 14 16 7 + 6 10 3 18 5 + 1 12 20 15 19 + + 3 15 0 2 22 + 9 18 13 17 5 +19 8 7 25 23 +20 11 10 24 4 +14 21 16 12 6 + +14 21 17 24 4 +10 16 15 9 19 +18 8 23 26 20 +22 11 13 6 5 + 2 0 12 3 7 diff --git a/2021/day5/day5_part1.py b/2021/day5/day5_part1.py new file mode 100644 index 0000000..c40460d --- /dev/null +++ b/2021/day5/day5_part1.py @@ -0,0 +1,60 @@ +import numpy as np +import re +import sys + +f = open(sys.argv[1],"r") +cords=[] + +llist=[] + +for line in f: + if re.search("^[0-9]",line.rstrip()): + for i in line.rstrip().split(' -> '): + llist.append(i.rstrip().split(',')) + + +max_x = 0 +max_y = 0 +for i in llist: + if int(i[0]) > max_x: + max_x = int(i[0]) + + if int(i[1]) > max_y: + max_y = int(i[1]) + +#field = np.zeros((int(max_y)+1,int(max_x)+1)) +field = np.zeros((1000,1000)) + +for i in range(0,len(llist)-1,2): + x = int(llist[i][0]) + y = int(llist[i][1]) + + X = int(llist[i+1][0]) + Y = int(llist[i+1][1]) + #print('Compare ' + str(x)+','+str(y)+' and '+ str(X) + ',' + str(Y)) + if x != X and y == Y: + if x > X: + temp = x + x = X + X = temp + print('X: Going from ' + str(x) + ' to ' + str(X)) + for j in range(x,X+1): + field[y][j] += 1 + #print(field) + if y != Y and x == X: + print('Y: Going from ' + str(y) + ' to ' + str(Y)) + if y > Y: + temp = y + y = Y + y = temp + for j in range(y,Y+1): + field[j][x] += 1 + #print(field) + +count = 0 + +for i in field: + for j in i: + if int(j) >= 2: count+=1 + +print(count) diff --git a/2021/day5/test_input b/2021/day5/test_input new file mode 100644 index 0000000..b258f68 --- /dev/null +++ b/2021/day5/test_input @@ -0,0 +1,10 @@ +0,9 -> 5,9 +8,0 -> 0,8 +9,4 -> 3,4 +2,2 -> 2,1 +7,0 -> 7,4 +6,4 -> 2,0 +0,9 -> 2,9 +3,4 -> 1,4 +0,0 -> 8,8 +5,5 -> 8,2 diff --git a/2021/day6/test_input b/2021/day6/test_input new file mode 100644 index 0000000..55129f1 --- /dev/null +++ b/2021/day6/test_input @@ -0,0 +1 @@ +3,4,3,1,2 diff --git a/2022/day1/test_input b/2022/day1/test_input new file mode 100644 index 0000000..2094f91 --- /dev/null +++ b/2022/day1/test_input @@ -0,0 +1,14 @@ +1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000 diff --git a/2022/day2/test_input b/2022/day2/test_input new file mode 100644 index 0000000..db60e36 --- /dev/null +++ b/2022/day2/test_input @@ -0,0 +1,3 @@ +A Y +B X +C Z diff --git a/2022/day3/test_input b/2022/day3/test_input new file mode 100644 index 0000000..f17e726 --- /dev/null +++ b/2022/day3/test_input @@ -0,0 +1,6 @@ +vJrwpWtwJgWrhcsFMMfFFhFp +jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL +PmmdzqPrVvPwwTWBwg +wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn +ttgJtRGJQctTZtZT +CrZsJsPPZsGzwwsLwLmpwMDw diff --git a/2022/day4/test_input b/2022/day4/test_input new file mode 100644 index 0000000..9f9e9cf --- /dev/null +++ b/2022/day4/test_input @@ -0,0 +1,6 @@ +2-4,6-8 +2-3,4-5 +5-7,7-9 +2-8,3-7 +6-6,4-6 +2-6,4-8 diff --git a/2022/day5/test_input b/2022/day5/test_input new file mode 100644 index 0000000..764317b --- /dev/null +++ b/2022/day5/test_input @@ -0,0 +1,4 @@ +move 1 from 2 to 1 +move 3 from 1 to 3 +move 2 from 2 to 1 +move 1 from 1 to 2 diff --git a/2022/day6/test_input b/2022/day6/test_input new file mode 100644 index 0000000..7980a82 --- /dev/null +++ b/2022/day6/test_input @@ -0,0 +1 @@ +mjqjpqmgbljsphdztnvjfqwrcgsmlb diff --git a/2022/day6/test_input2 b/2022/day6/test_input2 new file mode 100644 index 0000000..19fe247 --- /dev/null +++ b/2022/day6/test_input2 @@ -0,0 +1 @@ +bvwbjplbgvbhsrlpgdmjqwftvncz diff --git a/2022/day6/test_input3 b/2022/day6/test_input3 new file mode 100644 index 0000000..0f12ee2 --- /dev/null +++ b/2022/day6/test_input3 @@ -0,0 +1 @@ +nppdvjthqldpwncqszvftbrmjlhg diff --git a/2022/day6/test_input4 b/2022/day6/test_input4 new file mode 100644 index 0000000..38510e7 --- /dev/null +++ b/2022/day6/test_input4 @@ -0,0 +1 @@ +nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg diff --git a/2022/day6/test_input5 b/2022/day6/test_input5 new file mode 100644 index 0000000..e1d0a43 --- /dev/null +++ b/2022/day6/test_input5 @@ -0,0 +1 @@ +zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw diff --git a/2022/day7/test_input b/2022/day7/test_input new file mode 100644 index 0000000..09a921e --- /dev/null +++ b/2022/day7/test_input @@ -0,0 +1,23 @@ +$ cd / +$ ls +dir a +14848514 b.txt +8504156 c.dat +dir d +$ cd a +$ ls +dir e +29116 f +2557 g +62596 h.lst +$ cd e +$ ls +584 i +$ cd .. +$ cd .. +$ cd d +$ ls +4060174 j +8033020 d.log +5626152 d.ext +7214296 k diff --git a/2022/day8/test_input b/2022/day8/test_input new file mode 100644 index 0000000..16d6fbd --- /dev/null +++ b/2022/day8/test_input @@ -0,0 +1,5 @@ +30373 +25512 +65332 +33549 +35390 diff --git a/2023/day10/t2.2 b/2023/day10/t2.2 new file mode 100644 index 0000000..adaae96 --- /dev/null +++ b/2023/day10/t2.2 @@ -0,0 +1,10 @@ +.F----7F7F7F7F-7.... +.|F--7||||||||FJ.... +.||.FJ||||||||L7.... +FJL7L7LJLJ||LJ.L-7.. +L--J.L7...LJS7F-7L7. +....F-J..F7FJ|L7L7L7 +....L7.F7||L7|.L7L7| +.....|FJLJ|FJ|F7|.LJ +....FJL-7.||.||||... +....L---J.LJ.LJLJ... diff --git a/2023/day10/t2.3 b/2023/day10/t2.3 new file mode 100644 index 0000000..273b816 --- /dev/null +++ b/2023/day10/t2.3 @@ -0,0 +1,10 @@ +FF7FSF7F7F7F7F7F---7 +L|LJ||||||||||||F--J +FL-7LJLJ||||||LJL-77 +F--JF--7||LJLJ.F7FJ- +L---JF-JLJ....FJLJJ7 +|F|F-JF---7...L7L|7| +|FFJF7L7F-JF7..L---7 +7-L-JL7||F7|L7F-7F7| +L.L7LFJ|||||FJL7||LJ +L7JLJL-JLJLJL--JLJ.L diff --git a/2023/day10/t2.4 b/2023/day10/t2.4 index 97d940f..0a35d88 100644 --- a/2023/day10/t2.4 +++ b/2023/day10/t2.4 @@ -2,7 +2,7 @@ FF7F┼F7F7F7F7F7F---7 L|LJ||||||||||||F--J FL-7LJLJ|S||||LJL-77 F--JF--7||LJLJ7F7FJ- -L---JF-JFJ.||-FJLJJ7 +L---JF-JLJ.||-FJLJJ7 |F|F-JF---7F7-L7L|7| |FFJF7L7F-JF7|JL---7 7-L-JL7||F7|L7F-7F7| diff --git a/2023/day7/exp b/2023/day7/exp deleted file mode 100644 index c0e0da8..0000000 --- a/2023/day7/exp +++ /dev/null @@ -1,23 +0,0 @@ -J2566 131 -K7KK7 272 -AA222 222 -222AA 123 -44T55 467 -4K339 546 -42TT2 174 -TQTTT 710 -84766 682 -K22KK 607 -77595 922 -26778 768 -JJ667 198 -JJ2JJ 123 -44Q9A 821 -T6682 851 -3A232 890 -5Q5J4 691 -79789 305 -KK666 138 -TT9TT 742 -Q4276 489 -6T48J 921 diff --git a/2023/day7/exp2 b/2023/day7/exp2 deleted file mode 100644 index fc14b25..0000000 --- a/2023/day7/exp2 +++ /dev/null @@ -1,9 +0,0 @@ -2J345 213 -22345 425 -2JJ34 654 -22234 234 -2JJJ3 623 -22223 658 -J2JJJ 987 -2JJJJ 456 -22222 604