commit c96fa0e7c3babdaebbd2008a21cc0a57c96c9575 Author: Yann Esposito (Yogsototh) Date: Thu Dec 29 14:20:34 2022 +0100 initial commit ex5 done diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d956ab0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/target +/classes +/checkouts +profiles.clj +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +/.prepl-port +.hgignore +.hg/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..586ed55 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,24 @@ +# Change Log +All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). + +## [Unreleased] +### Changed +- Add a new arity to `make-widget-async` to provide a different widget shape. + +## [0.1.1] - 2022-12-28 +### Changed +- Documentation on how to make the widgets. + +### Removed +- `make-widget-sync` - we're all async, all the time. + +### Fixed +- Fixed widget maker to keep working when daylight savings switches over. + +## 0.1.0 - 2022-12-28 +### Added +- Files from the new template. +- Widget maker public API - `make-widget-sync`. + +[Unreleased]: https://sourcehost.site/your-name/aot/compare/0.1.1...HEAD +[0.1.1]: https://sourcehost.site/your-name/aot/compare/0.1.0...0.1.1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2315126 --- /dev/null +++ b/LICENSE @@ -0,0 +1,280 @@ +Eclipse Public License - v 2.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from + and are Distributed by that particular Contributor. A Contribution + "originates" from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's behalf. + Contributions do not include changes or additions to the Program that + are not Modified Works. + +"Contributor" means any person or entity that Distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which +are necessarily infringed by the use or sale of its Contribution alone +or when combined with the Program. + +"Program" means the Contributions Distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement +or any Secondary License (as applicable), including Contributors. + +"Derivative Works" shall mean any work, whether in Source Code or other +form, that is based on (or derived from) the Program and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. + +"Modified Works" shall mean any work in Source Code or other form that +results from an addition to, deletion from, or modification of the +contents of the Program, including, for purposes of clarity any new file +in Source Code form that contains any contents of the Program. Modified +Works shall not include works that contain only declarations, +interfaces, types, classes, structures, or files of the Program solely +in each case in order to link to, bind by name, or subclass the Program +or Modified Works thereof. + +"Distribute" means the acts of a) distributing or b) making available +in any manner that enables the transfer of a copy. + +"Source Code" means the form of a Program preferred for making +modifications, including but not limited to software source code, +documentation source, and configuration files. + +"Secondary License" means either the GNU General Public License, +Version 2.0, or any later versions of that license, including any +exceptions or additional permissions as identified by the initial +Contributor. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare Derivative Works of, publicly display, + publicly perform, Distribute and sublicense the Contribution of such + Contributor, if any, and such Derivative Works. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in Source Code or other form. This patent license shall + apply to the combination of the Contribution and the Program if, at + the time the Contribution is added by the Contributor, such addition + of the Contribution causes such combination to be covered by the + Licensed Patents. The patent license shall not apply to any other + combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to Distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + e) Notwithstanding the terms of any Secondary License, no + Contributor makes additional grants to any Recipient (other than + those set forth in this Agreement) as a result of such Recipient's + receipt of the Program under the terms of a Secondary License + (if permitted under the terms of Section 3). + +3. REQUIREMENTS + +3.1 If a Contributor Distributes the Program in any form, then: + + a) the Program must also be made available as Source Code, in + accordance with section 3.2, and the Contributor must accompany + the Program with a statement that the Source Code for the Program + is available under this Agreement, and informs Recipients how to + obtain it in a reasonable manner on or through a medium customarily + used for software exchange; and + + b) the Contributor may Distribute the Program under a license + different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and fitness + for a particular purpose; + + ii) effectively excludes on behalf of all other Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) does not attempt to limit or alter the recipients' rights + in the Source Code under section 3.2; and + + iv) requires any subsequent distribution of the Program by any + party to be under a license that satisfies the requirements + of this section 3. + +3.2 When the Program is Distributed as Source Code: + + a) it must be made available under this Agreement, or if the + Program (i) is combined with other material in a separate file or + files made available under a Secondary License, and (ii) the initial + Contributor attached to the Source Code the notice described in + Exhibit A of this Agreement, then the Program may be made available + under the terms of such Secondary Licenses, and + + b) a copy of this Agreement must be included with each copy of + the Program. + +3.3 Contributors may not remove or alter any copyright, patent, +trademark, attribution notices, disclaimers of warranty, or limitations +of liability ("notices") contained within the Program from any copy of +the Program which they Distribute, provided that Contributors may add +their own appropriate notices. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities +with respect to end users, business partners and the like. While this +license is intended to facilitate the commercial use of the Program, +the Contributor who includes the Program in a commercial product +offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes +the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every +other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits +and other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program +in a commercial product offering. The obligations in this section do not +apply to any claims or Losses relating to any actual or alleged +intellectual property infringement. In order to qualify, an Indemnified +Contributor must: a) promptly notify the Commercial Contributor in +writing of such claim, and b) allow the Commercial Contributor to control, +and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those performance +claims and warranties, and if a court requires any other Contributor to +pay any damages as a result, the Commercial Contributor must pay +those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF +TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE. Each Recipient is solely responsible for determining the +appropriateness of using and distributing the Program and assumes all +risks associated with its exercise of rights under this Agreement, +including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs +or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS +SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software +or hardware) infringes such Recipient's patent(s), then such Recipient's +rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign the +responsibility to serve as the Agreement Steward to a suitable separate +entity. Each new version of the Agreement will be given a distinguishing +version number. The Program (including Contributions) may always be +Distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to Distribute the Program (including its +Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient +receives no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted +under this Agreement are reserved. Nothing in this Agreement is intended +to be enforceable by any entity that is not a Contributor or Recipient. +No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice + +"This Source Code may also be made available under the following +Secondary Licenses when the conditions for such availability set forth +in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public +License as published by the Free Software Foundation, either version 2 +of the License, or (at your option) any later version, with the GNU +Classpath Exception which is available at +https://www.gnu.org/software/classpath/license.html." + + Simply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. + + If it is not possible or desirable to put the notice in a particular + file, then You may include the notice in a location (such as a LICENSE + file in a relevant directory) where a recipient would be likely to + look for such a notice. + + You may add additional accurate notices of copyright ownership. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4127c6e --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# aot + +A Clojure library designed to ... well, that part is up to you. + +## Usage + +FIXME + +## License + +Copyright © 2022 FIXME + +This program and the accompanying materials are made available under the +terms of the Eclipse Public License 2.0 which is available at +http://www.eclipse.org/legal/epl-2.0. + +This Source Code may also be made available under the following Secondary +Licenses when the conditions for such availability set forth in the Eclipse +Public License, v. 2.0 are satisfied: GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or (at your +option) any later version, with the GNU Classpath Exception which is available +at https://www.gnu.org/software/classpath/license.html. diff --git a/doc/intro.md b/doc/intro.md new file mode 100644 index 0000000..262ec8d --- /dev/null +++ b/doc/intro.md @@ -0,0 +1,3 @@ +# Introduction to aot + +TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..bd42313 --- /dev/null +++ b/project.clj @@ -0,0 +1,7 @@ +(defproject aot "0.1.0-SNAPSHOT" + :description "FIXME: write description" + :url "http://example.com/FIXME" + :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" + :url "https://www.eclipse.org/legal/epl-2.0/"} + :dependencies [[org.clojure/clojure "1.10.3"]] + :repl-options {:init-ns aot.core}) diff --git a/resources/2022/01/input.txt b/resources/2022/01/input.txt new file mode 100644 index 0000000..d1a1625 --- /dev/null +++ b/resources/2022/01/input.txt @@ -0,0 +1,2242 @@ +62797 + +1137 +6086 +6104 +1895 +7909 +1651 +4973 +6964 +5989 +6003 +6859 + +2817 +3841 +5360 +2614 +1746 +3507 +1159 +3226 +4541 +1007 +3881 +4243 +1733 +4184 +2377 + +2528 +2950 +5635 +3664 +5782 +4580 +4672 +5989 +3426 +5600 +2057 +2901 +6175 + +48610 + +8330 +9058 +2953 +10409 +10515 +6073 +6772 +2197 + +1454 +1167 +5647 +5849 +2001 +1754 +3536 +1370 +1518 +1575 +5506 +3905 + +2339 +2355 +5373 +5845 +5561 +2919 +6506 +1409 +5879 +4604 +4714 +2980 +4867 +1823 + +4103 +20451 +23221 + +3067 +1509 +7380 +6207 +1031 +8739 +1796 +7860 +8132 + +2552 +4885 +14523 +4281 +8129 + +8511 +1435 +4589 +2922 +9486 +8125 +9379 +3055 +3639 + +38740 + +16211 +4294 +7687 +1712 + +10099 +9368 +7818 +11449 +3561 +2537 +11958 + +7674 +6052 +3795 +3846 +4678 +3629 +7318 +6585 +2001 +7220 +5358 + +9548 +4062 +7399 +7033 +11264 + +46275 + +2748 +20038 +7423 + +6073 +3395 +3001 +1685 +3782 +4034 +7477 +2787 +5189 +4928 +7834 + +6152 +2078 +3983 +5973 +3099 +2668 +5509 +6790 +5095 +5716 +3928 +3651 +4353 + +2324 +4994 +7860 +6198 +5793 +8073 +6584 +3618 + +5454 +4393 +2767 +3584 +3049 +1330 +6495 +2401 +2032 +6093 +4161 +2423 +2227 +1485 + +47294 + +3251 +4899 +4344 +7427 +5739 +3455 +7449 +6505 +5732 +5556 +4162 + +7382 +6713 +2642 +3282 +6120 +6768 +2510 +1058 +5668 +3874 +6522 +2193 + +68177 + +1202 +16326 +5274 + +5407 +4950 +1632 +7838 +7200 +2903 +7157 +7222 +2700 +1327 +3808 + +9007 +18835 + +8076 +2472 +8440 +2343 +3318 +1370 +7294 +7302 +1086 +7312 + +3203 +1707 +2442 +4856 +2106 +4742 +5322 +1625 +3597 +1216 +1860 +2986 +4170 +2550 +2291 + +1334 +5510 +6574 +7667 +3351 +5168 +1992 +1642 +7325 +3045 +3026 + +11629 +30436 + +4759 +4378 +2336 +2445 +1654 +3107 +3573 +5823 +3674 +5412 +4144 +6008 +5593 +2144 + +4744 +3597 +7879 +9312 +2539 +6903 +5299 +2385 +1285 + +2235 +1842 +2412 +3271 +7324 +4749 +4947 +6445 +3707 +5131 +6081 +2996 + +6119 +1077 +1532 +3836 +3825 +1677 +2989 +2320 +2993 +4053 +3514 +4403 +2769 +1642 + +3576 +1351 +2614 +1445 +5560 +1064 +1447 +3491 +4846 +1895 +4172 +5915 +4801 +6360 + +5495 +3521 +1020 +7024 +2201 +1956 +5994 +7108 +4368 +6589 +2125 + +9607 +7759 +8294 +9219 +13252 +9410 + +1002 +2930 +2950 +1481 +4450 +6035 +4757 +3031 +1162 +4348 +3853 +4003 +3810 +5328 +3700 + +7222 +7908 +10261 +8815 +5428 +5628 + +5901 +5817 +2869 +4236 +3255 +6376 +3519 +3320 +1550 +5964 +3036 +6141 +3363 +3451 + +8692 +5150 +6968 +2349 +9604 +1650 +5346 +4464 + +14434 + +1269 +2245 +3604 +4102 +3153 +4847 +5630 +1368 +4024 +3184 +3043 +4360 +5111 +2277 +4309 + +1028 +5088 +4334 +2923 +4670 +5247 +2517 +2019 +2905 +2714 +4577 +6086 +3578 +3444 + +3577 +1890 +2953 +6922 +2579 +8789 +5689 +3900 +5203 +2389 + +9776 +2610 +4602 +5502 +10238 +4465 +7608 +4954 + +8619 +4813 +7994 +2818 +3322 +4977 +4664 +8612 +1085 +1957 + +8435 +2875 +8535 +2645 +5352 +5266 +8246 + +6632 +4577 +2210 +6604 +6558 +7280 +6908 +2512 +6758 +2750 + +1126 +9574 +9451 +16976 + +5250 +6844 +3339 +7324 +6934 +5858 +6420 +1676 +8578 + +5335 +10082 +9784 +4599 +7897 +7693 +8058 + +18781 +3566 +20903 + +6380 +1702 +3926 + +3902 +6939 +8036 +5419 +1289 +5025 +5554 +3435 +3332 +1916 + +7356 +12520 +7346 +11017 +11388 +4624 + +5334 +5736 +5901 +1639 +1296 +2931 +4830 +4069 +4097 +5665 +5529 +5345 +4527 +2858 + +5476 +1781 +6609 +4309 +7392 +1871 +5736 +7117 +6936 +3482 +4152 + +4186 +6365 +5636 +4565 +4235 +6395 +2761 +3815 +7923 +6308 +7684 + +9859 +4769 +8278 +12910 +1311 +2143 + +2474 +3505 +2759 +3216 +3787 +3693 +2637 +3237 +5553 +5879 +5727 +2734 +3346 +2406 + +2187 +4922 +1515 +2084 +3633 +6094 +1252 +6325 +3206 +5142 +6339 +1757 +5358 + +11241 +7086 +6813 +14664 +1548 + +7377 +5783 +11235 +9630 +4109 +8722 + +16111 +3786 +13852 +14660 +14906 + +3257 +9139 +2882 +5982 +10228 +3118 + +13293 +5413 +11057 + +12677 +17863 +9645 + +3589 +13556 +15197 +7093 + +7078 +9565 +15193 +7844 + +5907 +1152 +2321 +3793 +1991 +7892 +10004 +3540 + +5861 +11769 +10640 +9553 +1750 +3876 + +4046 +2345 +5389 +5518 +6114 +5106 +5426 +3467 +1493 +1241 +5264 +5131 +3364 +5723 + +1905 +2588 +4692 +3798 +1245 +6449 +3754 +1998 +6074 +3699 +2096 +1999 +5222 +5688 + +10979 +5452 +2078 +11543 + +1844 +7544 +10666 +5272 +6913 +8789 +7957 +8348 + +4984 +7278 +2353 +2444 +7917 +5469 +8641 +1132 +4171 +4078 + +20787 +18527 + +5276 +6022 +1680 +4706 +2061 +5053 +3811 +2078 +2219 +3921 +4008 +3360 +1241 +3652 +5379 + +3261 +1286 +12019 +15867 + +9142 +6718 +6759 +1763 +5639 +8586 +2769 +8583 +5679 + +7839 +7346 +6043 +2270 +8994 +2060 +12109 + +47450 + +4222 +3717 +2902 +1498 +3681 +1365 +5850 +4158 +3379 +2187 +1534 +3932 +4737 +6031 + +4562 +4430 +3096 +2073 +6403 +4148 +3698 +2477 +3360 +2148 +2615 +2159 +6438 +1214 + +6891 +6856 +7163 +2424 +7346 +4006 +3889 +5080 +4668 +5496 +6872 + +8337 +13654 + +3495 +8348 +5138 +3214 +5881 +2857 +6331 +7476 +1135 +4155 + +4699 +7203 +6356 +8627 +2205 +5096 +2580 +7067 +1478 +4245 + +3098 +8610 +9747 +3238 +10772 +4767 +8079 +5361 + +7130 +5330 +9323 +4661 +3677 +2658 +9525 +9844 + +1451 +1186 +1323 +3923 +4568 +1052 +4270 +4108 +3231 +4942 +5792 +6037 +5366 +5402 + +9001 +15082 +9282 +11469 +7401 + +2070 +2095 +3183 +6326 +1557 +4983 +6324 +1198 +5658 +5539 +4435 +5491 +1304 + +7164 +2101 +8308 +3432 +6310 +9321 +6141 +6546 +7730 + +6191 +4811 +1707 +3732 +7322 +3741 +5246 +2825 +5243 +4113 +4916 + +5626 +7351 +3369 +2744 +2540 +3542 +5842 +3729 +1105 + +1135 +13062 +2337 +14278 + +8078 +8178 +4760 +8051 +1113 +4351 +5652 +5403 +4777 + +4998 +1638 +3990 +5943 +2335 +4550 +4345 +3359 +1514 +4685 +4102 +4274 +6022 +5273 + +7334 +7391 +6920 +5420 +6627 +3521 +6289 +6204 +6416 +4061 +4534 + +4935 +3249 +3556 +3618 +4499 +4136 +1690 +5033 +2002 +2454 +1912 +2113 +4829 +4944 +2339 + +4860 +1381 +5035 +4417 +3075 +2366 +3567 +1740 +3126 +1691 +1147 +1525 + +13371 +14166 +9536 +10956 +2600 + +3575 +2155 +4514 +2401 +3693 +6379 +6587 +1079 +4094 +3327 +7573 + +3948 +5553 +3883 +1557 +4833 +4933 +4883 +1973 +2027 +4852 +5735 +5726 +1879 +1185 +3525 + +2863 +1210 +2359 +6505 +3668 +2682 +5567 +6375 +6425 +6476 +6051 +1022 +5208 +3114 + +8666 +11550 +4922 +3332 +7784 +6833 +3659 + +3279 +3382 +8593 +9552 +2903 + +2951 +2006 +1185 +5092 +5625 +1309 +4907 +3835 +2464 +2644 +5631 +2786 +4778 +2325 +4312 + +9449 +9341 +8140 +8892 +5531 +1109 +7598 +8012 + +5204 +5931 +4082 +3376 +3591 +2371 +4945 +2603 +6084 +2646 +5100 +3494 +5278 +3099 + +11334 +6895 +3636 +6227 +5295 +12703 + +8582 +6879 + +10795 +11724 +13546 +14298 + +12038 +3535 +11070 +8190 +1032 +1780 +8630 + +10640 +13274 +10643 +11940 +10745 +9333 + +5299 +6239 +1648 +6467 +6426 +2154 +7880 +5169 +3356 +6129 +5647 + +6595 +2143 +1898 +12562 +13508 +2781 + +59552 + +16571 +4935 +17641 +12096 + +6189 +3250 +5458 +5146 +5237 +2684 + +18772 +5692 +9163 +9268 + +5695 +3416 +2703 +3018 +4433 +1425 +1974 +4673 +2166 +3893 +3446 +1994 +2070 +2429 + +3554 +5665 +3356 +4739 +1915 +6877 +5874 +2883 +2279 +4966 +7503 + +1155 +2329 +5544 +2294 +3644 +6202 +7787 +6605 +7045 + +3263 +1268 +2627 +1220 +5707 +1469 +4518 +5697 +3414 +2047 +2939 +3679 +2503 +5031 +3764 + +5935 +3138 +2639 +4127 +5061 +2213 +5332 +5037 +4830 +3694 +3624 +3598 +4000 +2683 + +5122 +6805 +10017 +1863 +11675 +2237 +10887 + +1055 +1975 +2769 +6245 +3790 +1178 +2163 +5553 +5305 +6089 +1417 +1221 +6235 + +54647 + +8508 +5207 +1608 +3986 +8532 +7425 +4530 +8413 +2097 + +33681 + +2280 +7109 +2871 +6096 +6170 +1314 +4713 +1607 +4944 +3316 +2818 + +7431 +1166 +6475 +1105 +1780 +5602 +5682 +6187 +4856 +7860 +3409 + +4299 +3875 +3364 +4489 +3995 +1565 +4798 +2285 +1420 +5877 +3158 +3045 +2505 +1329 + +9029 +1967 +7691 +3366 +7301 +2855 +4228 +3900 +2025 + +3340 +6056 +5221 +5220 +1911 +2349 +3789 +3567 +2859 +3079 +5720 +1134 +3072 +1291 + +22613 +20435 +13975 + +14789 + +5745 +5492 +1882 +3895 +6104 +8598 +3351 +1932 +4913 +2592 + +1662 +3183 +3923 +5857 +6563 +3160 +3119 +5727 +6071 +3931 + +6513 +1218 +10399 +3885 +3363 +2470 +9626 +3802 + +6307 +2664 +9753 +10741 +1295 + +3046 +1421 +4492 +2172 +6367 +5986 +1478 +1235 +1913 +1700 +2661 +3187 +3694 +1704 + +2332 +2555 +1548 +1891 +3985 +2238 +3802 +4168 +5491 +1374 +5104 +6353 + +64543 + +2774 +7026 +2622 +1898 +7236 +1896 +4399 +3438 +2436 +2732 +7431 +2737 + +5452 +3365 +8054 +2730 +4786 +11186 + +2474 +22732 + +2187 +2855 +7552 +9401 +6355 +10015 +4238 +9319 + +7351 +5587 +3761 +6320 +4344 +7272 +1465 +1207 +5586 +6134 +2607 +6004 + +6759 +4749 +4338 +1058 +5400 +3173 +3262 +7818 +6438 +5852 +6804 + +11175 +14866 +6020 +1809 +1258 + +4816 +3171 +6714 +2291 +4243 +4824 +10385 +4451 + +3102 +5924 +6672 +1872 +1009 +1176 +5943 +2068 +3702 + +14085 +14731 + +5651 +6762 +1985 +5851 +7277 +1493 +7316 +1193 +3737 +3291 + +1918 +9163 +3715 +5271 +8317 +3085 +2782 +7762 +5383 + +1195 +2050 +4127 +1946 +5662 +1608 +6606 +6708 +2771 +5533 +2638 +6048 + +8916 +2959 +16153 +3649 + +17831 +11271 +4407 +11756 + +1932 +5296 +4133 +3164 +2942 +5498 +4442 +4447 +3267 +4143 +2401 +5074 +1831 +4235 + +1529 +1414 +4775 +3829 +3121 +3573 +3423 +3269 +1017 +4698 +5104 +2655 +2427 +5958 + +1209 +7712 +3681 +6730 +6569 +1763 +5465 +2218 +4656 +1828 + +2045 +10343 +3841 +7177 +8506 +12930 + +3801 +4977 +5578 +2208 +4739 +4811 +2201 +3004 +5233 +4112 +5234 +5615 +2187 + +7309 +7544 +1423 +2269 +5221 +4858 +4996 +1683 +9331 + +1834 +6149 +6941 +1568 +1886 +6818 +7022 +5841 +5568 +8000 +3910 + +8233 +5998 +2020 +6423 +7691 +1420 +5081 +8221 +5648 +7694 + +14918 +18742 +10687 +19905 + +3390 +8841 +2124 +10402 +4664 +10831 + +9777 +7834 +10672 +9873 +6758 +1471 +11828 + +1679 +6895 +6007 +2245 +8309 +3319 +1232 +10468 + +51082 + +2292 +6231 +3446 +3591 +1553 +1615 +1514 +6233 +6327 +3430 +1732 +5356 +4799 + +2583 +4699 +5594 +3530 +3477 +3473 +4356 +3594 +5404 +2738 +5766 +5897 +2218 +1597 +3830 + +4683 +4634 +6635 +5255 +2092 +6636 +3209 +7142 +1022 + +6301 +9915 +4277 +11866 +10155 + +24693 +24851 + +4192 +10576 +9003 +7156 +11894 + +8088 +14949 +19773 +13274 + +4683 +22445 +14904 + +10069 +9513 +7768 +11446 +6753 +12021 + +2863 +6080 +3395 +2648 +6585 +1411 +3363 +5331 +2830 +1437 +3281 +5924 +6409 + +6012 +4523 +1688 +5603 +3035 +3220 +7254 +4670 +6197 +4181 +6032 +4619 + +2186 +5986 +5703 +3074 +7566 +4097 +7971 +4868 +7182 +5065 +1279 + +10973 +9182 +13792 +9868 +1509 +9266 + +2846 +4728 +5432 +1085 +4273 +1620 +3800 +1631 +1141 +4895 +1402 +5547 +1131 +2330 + +8273 +3309 +8168 +12350 +11300 +4743 + +11440 +5977 +1085 +13808 +2190 +9288 + +2271 +11361 + +4963 +1680 +7510 +5354 +2117 +7728 +6051 +5256 +3478 +1075 +1961 + +3812 +4709 +2691 +4316 +3328 +2828 +2937 +2812 +1539 +5201 +1182 +2697 +2406 +2574 +4539 + +4415 +8204 +1583 +10931 +7518 +3135 +11661 + +3389 +5173 +5986 +3872 +3959 +8821 +7434 +2166 +8156 + +2463 +4935 +7038 +6770 +5818 +6881 +2282 +7335 +4367 +1801 +2507 +4071 + +9939 +14902 +7567 +15568 +10587 + +2163 +2588 +2715 +4589 +6593 +6838 +4404 +3186 +4271 +3686 +3641 +5165 +5708 + +6209 +13133 +25360 + +3109 +5778 +4388 +1042 +4937 +8197 +1456 +8167 + +9199 +7098 +14027 + +6382 +1660 +2778 +8067 +3405 +2429 +6503 +7984 +5799 +7534 +5088 + +9638 +14010 +5875 +6893 + +2598 +2706 +3987 +4140 +3171 +5672 +5529 +3617 +5198 +2429 +2728 +4763 +2852 +5389 + +3719 +1285 +4554 +3677 +5209 +3827 +5062 +4835 +8068 +4674 +5854 + +6077 +6747 +6325 +4287 +7242 +6317 +3989 +6724 +1754 +5498 +1931 + +10902 +11104 +10540 +4778 +7178 +4711 + +1705 +3407 +6048 +3364 +3743 +3938 +4784 +6080 +3543 +1957 +2590 +2031 + +28157 +6204 + +7129 +7476 +1886 +10496 +4930 +2967 +1258 +3532 + +4133 +2586 +1916 +4464 +1008 +3310 +5367 +4347 +5569 +3878 +3210 +2442 +2355 +5997 +3101 + +4460 +18575 +6967 +17122 + +1720 +2723 +5410 +8981 +3355 +4210 +2549 +3094 + +14639 +17107 +14832 + +3736 +24734 + +3133 +3998 +5708 +6961 +1514 +3927 +4208 +5004 +2708 +1381 +5082 +4476 + +4021 +1075 +1593 +3541 +2463 +4776 +4665 +6168 +1928 +6421 +3967 +5875 +2584 +1946 + +3506 +1054 +1846 +4946 +3394 +7435 +7099 +3703 +6746 +2129 +1980 +4505 + +7828 +8885 +8007 +4297 +1731 +3825 +1728 +4304 + +3217 +12089 +2242 +10288 +9462 +11809 + +10335 +3139 +10617 +6833 +1976 +3093 +8219 + +7749 +5487 +7508 +6975 +5363 +4141 +3823 +7609 +5667 +4064 +7969 + +6803 +1600 +8970 +8154 +3949 +9138 +6012 +4745 +6778 + +5215 +8264 +3784 +14282 + +5819 +13811 +5523 +3645 + +12004 +8659 +1039 +1507 +3797 +2568 +12129 + +3547 +7073 +5035 +2269 +7986 +6478 +5045 +6103 +1003 +7281 +7503 + +2567 +6027 +6497 +5871 +2833 +2117 +4851 +4934 +6324 +4101 +2032 +4308 +4369 + +4262 +15796 +13104 +9996 + +4521 +4209 +4691 +11223 +1369 +11416 +8253 + +8708 +11136 +15770 + +1132 +1488 +4493 +5822 +3022 +4249 +1436 +5324 +4237 +3740 +3071 +1298 +5247 +5217 + +6199 +9151 +9154 +8903 +9415 +6703 +7137 +7053 +4727 + +15631 +16811 +14050 + +5183 +4988 +3932 +6304 +6914 +4061 +5694 +5111 +3668 +5769 +6458 +6400 +3736 diff --git a/resources/2022/01/test.txt b/resources/2022/01/test.txt new file mode 100644 index 0000000..2094f91 --- /dev/null +++ b/resources/2022/01/test.txt @@ -0,0 +1,14 @@ +1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000 diff --git a/resources/2022/02/input.txt b/resources/2022/02/input.txt new file mode 100644 index 0000000..cc70403 --- /dev/null +++ b/resources/2022/02/input.txt @@ -0,0 +1,2500 @@ +C Y +B Y +C Y +B X +B X +B X +C Y +B Z +A Z +A Z +A Z +A Y +A X +A Z +A X +A Z +C Y +A X +A Z +A Z +A Z +A Y +C Y +B Z +B Z +C Y +C Y +C Y +C Y +A X +B Z +C X +B X +A Y +C X +C Y +C Y +B X +C X +B Z +C Y +B X +C Y +B X +B X +C Y +A X +B X +B Z +B X +A Z +B Z +B X +B Y +C Y +A X +C Y +A Z +C Y +C Z +B Z +C Y +C Y +C Y +B Y +B X +B X +A X +B Z +B X +B X +B X +B X +B Y +B X +B X +B X +B X +B Z +B X +B X +B Y +B X +C Y +C Y +B Z +A Z +A X +B X +B X +A X +B X +A X +B X +A Z +B Y +A X +A Y +C Y +A X +A X +C Y +A Z +B X +B Y +C Z +C Y +B X +B X +A Z +B X +B X +C Y +A Z +A Z +B X +C X +B Z +C Y +B X +A Y +C Y +B Z +C Y +B Z +A X +C Y +C Z +B X +B X +C X +A X +B X +B Z +B Z +B Z +A Y +B Z +B X +C Y +B Z +A Z +C Y +C Y +A Z +C Y +B X +B X +C Y +B Z +B Z +C Y +A X +C Y +C Y +B X +B Y +C Y +C Y +A Z +B Z +B X +B X +C Z +C Y +A X +B Z +B Y +C Y +C Y +B X +B Z +C X +B X +C Y +B Z +A X +B X +B Z +A X +C Y +B X +B X +C Y +A X +B X +B Y +A X +A Y +C Y +C Y +B X +A Z +A X +B Y +A X +A X +C X +C Y +B Y +A Z +C X +A X +B Z +B X +B X +C Y +A X +C X +C Y +A X +C Y +B X +B X +C Y +C Y +B X +A X +B X +A X +C Y +B Y +B Z +B X +B X +C X +C Y +B Z +C Y +C Y +B X +A Z +B Z +A Z +A Z +C Y +B X +C Y +C Y +C X +B X +C X +C Z +C Y +B Z +C Z +C Y +A Z +B X +C X +B Y +B Z +C Y +B Z +B Z +B Z +A Z +C X +A Y +B Z +A Z +B Z +B Y +A Z +C Y +C Y +B X +A X +B X +C X +B Y +C Y +B Z +B X +C Y +A X +B Z +B Y +C X +C Y +B X +A Z +A Z +C Y +B Z +B Z +B X +B X +C X +B X +B X +B X +A Z +A X +C Z +B X +A Z +B X +C X +B X +C X +B Z +B X +B X +A X +B Z +B Y +A Z +A Z +C Y +C Y +A Z +A Z +B X +A X +B Z +C X +C Y +C Y +B Z +A X +B Y +B Z +A X +C Y +B Z +A X +B X +B X +C Y +C Z +A Y +A X +C Y +A Z +C X +A Z +A Z +C X +A X +A Z +B Z +A Y +A Z +C Y +B X +B X +B Z +B X +B X +B Y +B X +B X +C Y +B X +A Z +B X +C Y +A Z +B Z +C Y +C X +C Y +B X +C Y +B Y +B X +B Z +C Y +A X +A X +C X +B X +A X +C X +B Y +B Y +A Z +C Z +C Z +A X +C Y +A Y +A Z +B Z +A Z +A X +A Y +B X +B Y +C Y +A X +B Y +C X +C Y +B Z +C Y +A X +B Z +B Z +A X +C X +B X +A X +B Z +C Y +C Y +B Y +A Y +B X +B Z +B X +C Y +B X +C Y +C X +A Z +B Z +C Y +B X +B Z +B Z +B Z +C Y +C X +C X +B X +A X +C Y +C Y +B X +B Z +C Y +A X +B X +B Z +B Z +B Y +A Y +B X +B Z +B X +A X +A Z +A Z +C X +B Y +B Z +C Z +B X +C Y +B X +C Y +B Y +B Z +B Y +B X +A Z +C X +A X +A Z +C Y +B X +C Y +C Y +B X +C Z +B Z +B Z +C X +C Y +A Y +C Y +A Y +B X +B Y +A Z +B Z +B X +B X +A X +C Y +B Z +C Y +B X +A Z +B Z +C Y +B Z +A Z +C Y +B X +B X +C Y +C Y +C Y +B X +C Z +B Z +B X +C Y +C X +B X +C Y +B Y +B Z +B Z +B Y +B Z +B Y +A Z +B X +B X +A Z +C Z +A Z +B X +C Z +A X +B X +C Y +B Z +A Z +C Y +C Y +B Z +A X +C Y +A Z +B X +B Z +B Y +B X +B Z +B X +C Y +A X +B Z +C Y +B Z +B Z +C Y +B X +B X +A Y +C Y +B Z +B Z +B X +B Z +A X +A X +C Y +B X +C Y +A Z +A X +B X +C Y +B Z +A Z +B X +A X +B X +B Y +A X +C Z +A X +B Y +B X +A Y +C Y +A Z +B X +C Y +A X +B X +C Y +A Z +B Y +A Z +B Z +B X +A X +B Y +A X +A Z +B Z +B X +B Z +C Y +C Y +C Y +B X +B Y +A Z +A Z +B X +B X +B Y +A X +A Z +C Y +A Y +B Z +A X +C X +A Z +C X +C Y +C Y +B X +B X +B Z +A X +A Z +B Y +B Z +B X +B Z +B X +C Y +B X +C Y +C Y +B X +B X +C Z +C Y +A X +A Z +C Y +C Y +A X +A Z +A X +C Y +C Y +B X +A X +C Y +B X +B X +A Z +B X +A Z +A Z +C Y +C Y +B X +C Y +B X +A X +C Y +B Z +A X +C Y +B Z +A X +A Z +C Y +C Y +B X +A X +B X +B Z +A Z +C X +B Z +A X +B Z +C Y +B X +A Z +C X +B Z +A Z +A X +C Y +B X +C Y +B X +A Z +B Z +B X +C X +B Z +B Y +C Y +B Z +B Z +B Z +B Z +C Y +C Y +A Z +C Y +C Z +C Z +C Y +C Y +B Z +A Y +B X +A Y +B Z +A Z +C Z +B X +B X +C X +A Z +C Y +A Z +B X +B X +A X +B Z +B X +C X +A Z +B Y +A X +B X +A Z +A X +B Z +C Y +B X +B X +C Y +C Y +B X +A Y +C X +B X +C X +B Y +B X +C Y +C Y +B X +A Z +A Z +A Y +B Z +B Z +B Z +C Y +A X +B X +C Y +C Y +A X +C Y +A Z +B X +A X +A Y +B Z +B Y +B Y +C X +A Z +A Z +B Z +A Z +B Z +B X +A Z +B Z +B Y +B X +B X +B X +A Y +A X +B X +B X +A X +C Y +B Z +C Y +B Y +A X +B Z +A Z +C Y +A X +C Y +B X +B Z +B Z +C Y +B Z +C Y +B X +C Y +A Z +A X +B X +C Y +A X +A X +C Y +C X +C Y +A Z +B Z +A X +C X +C X +C Y +B X +C X +A X +C Y +B Y +A X +C Y +B X +A Z +C Y +C Y +A X +A X +B X +B Y +B Y +A Y +A X +C Y +A X +C X +B X +C Y +C Y +A X +A Z +B Z +B Z +C Y +B Z +B Y +A X +C X +C X +A X +C Y +B Z +A Z +B X +C Y +C Y +C X +C Y +C X +A X +C Y +B X +C X +B X +A Z +B Z +B Z +B Z +B X +B Z +B X +B Y +C Y +C X +A Y +B Z +B Y +C Y +B Z +A X +A X +A Z +C Y +A X +C X +C Y +B Y +B X +B X +A X +B Y +C Y +B X +C X +C X +A Z +A Z +C Y +B X +B Z +C Y +B Z +B Z +C Y +C X +A X +B Z +C Y +C Y +C Y +B Z +B X +C Y +B Z +A X +B X +C Y +A Z +C Y +A Z +A Z +B Z +C Y +A Z +C Y +B X +A X +A X +B Z +C Y +B Y +B X +A Z +B X +C Y +A Z +C Y +A X +A Z +B X +B X +B Y +B X +A Z +C Y +A X +C Y +C Y +C Y +C Z +C Y +A Z +A Y +B Z +C Y +B X +C Y +C Y +A Z +C Z +C Y +B X +C Y +A Z +B Z +B Y +B Z +A Z +B X +B X +C X +B X +B Z +A X +C Y +C Y +C Y +A Z +B X +B Y +A X +A Z +C Y +A Z +A Z +B X +C Y +B Z +B Z +B X +C X +A Z +C X +B Z +C Y +A Z +B X +C Y +B X +A X +C Z +C X +C Y +A Z +C Y +B X +B X +B X +B X +B X +A Y +C Y +B X +A X +A Z +A Z +A X +C Z +B Z +C Y +B X +B Z +A X +B X +B X +C Y +B X +C Y +A Z +A Z +C X +B Z +A X +C Y +B X +C Y +C Y +C Y +B X +B Y +A Z +C Y +C Y +A X +A X +C Y +B X +B Z +C Y +A X +C Z +B Z +B X +C Y +C Y +B Z +A X +A Z +B X +C Y +A Z +A X +A Y +C Y +B X +B Z +A X +B Z +B Z +C Y +C Y +C X +B Z +A X +C Y +B Y +A Z +B X +B Y +B X +C Y +A Z +B X +A Z +C Y +B X +B X +C Y +B Y +C Y +C Y +C Y +B X +A X +C Y +C Y +C Y +A Z +C Y +B X +B X +B X +B X +A X +B Y +C X +B X +C X +A X +C X +C Y +A X +A Z +C Y +B Z +B Y +A X +B Y +C Y +C Y +B X +A X +A X +C X +B Z +C Y +C Y +A Z +B Z +B Z +C X +C Y +B X +B X +B Z +A Z +C Y +C Y +A Z +A Z +B X +B X +B Y +B Z +B Z +A Y +B Z +A Z +B Z +B X +B Z +C Z +B Z +A Z +B Z +B X +B X +B X +A X +C Y +A Z +C Y +C Y +B X +A Z +C X +B Z +B Y +C Z +B X +C Y +A X +C Y +A Y +B Z +C Y +C Y +B X +B X +A Z +C X +A X +A Z +B Y +C Y +C Y +C Y +B X +C Y +C Y +A Z +B X +A Z +C X +C Y +B Z +B Z +B Z +A Z +C Y +C Z +B Z +C Y +C Y +C Y +B X +B X +C Y +C Y +B X +A X +A Z +B X +C Y +B X +A Z +C Y +C Y +B Y +A X +A X +A X +A X +B X +B Y +C Y +A Z +B Y +B Z +A X +B X +C Y +A Y +C Y +A Z +B X +B Z +B Z +A Y +B X +B X +C Y +A Z +A Z +A X +A X +B Z +C Y +B Z +C X +A Z +C Y +B Z +C Y +C Y +B Z +A Z +C Y +C X +A Z +C Y +B X +A Y +A X +B Z +A Y +A Z +B X +C X +B Z +C Y +C Y +B Y +B Z +A X +B X +A Z +C Y +C Y +A Z +A Z +B X +C Y +B Z +A X +A X +B X +B Y +C Y +B X +C X +C Y +B Z +A Z +A Y +B X +C Y +C Y +C X +A Z +C Z +B Z +B X +A Z +A X +A X +B Z +B X +A Z +B Z +C Y +A X +B Z +B Z +C Y +C Y +A X +B X +C Y +A X +B X +C Y +B X +A Z +A X +B Z +A Z +B Z +B Y +A X +B Z +A Z +A Z +A Z +A X +A X +B X +B X +A Z +B Y +A Y +C Y +B X +C Y +B Y +C Y +A Z +A Z +B X +B X +C Y +B Z +C Y +B Z +B X +B X +B X +B X +A X +B Y +B X +C X +A Z +A Z +B X +C Y +C Y +C Y +A X +C Y +C Y +C Y +A X +C Y +C X +B X +A Y +C Z +C Y +A Z +B X +A Z +A X +B X +A X +A X +C Y +A Y +A X +B X +A Z +B Z +B Y +C Z +B X +A Z +C Y +B Z +B X +C Y +C Y +C Y +B X +A X +A Z +B X +A X +C Y +B Z +A X +C Y +C Y +A X +A X +A X +A Y +C Y +C Y +C Y +C Z +C Y +A X +B X +C Y +C Y +C Y +C Y +A X +B Z +A X +B X +C Y +B Z +A Z +C Y +A Z +C Y +B X +B X +C Y +C Y +B Y +A X +C Y +C X +C Y +C X +A Z +A Z +B Y +A X +A X +B Z +A Z +A X +A Z +C Y +A X +B Z +C X +A X +A X +B X +A X +B Y +A X +B X +B X +C Y +C X +B X +B Y +C X +A Z +B Z +B X +C Y +B Y +B Z +C Y +A X +C Y +B X +B X +C Y +C Z +B X +B X +C X +B Y +B Y +B Z +C X +B X +C Y +B X +C Y +B X +A X +A Y +B X +B X +B X +B Y +C Y +B X +B X +B X +C Y +A Z +B Z +B X +A Z +B X +B Y +C X +A Z +C Y +C Y +B Z +B X +C Y +C Y +C Y +C Y +B Z +A X +C Y +C Y +A Z +B X +B Z +A Y +C Y +B X +C Z +A Z +B Y +A Y +A Z +A Z +B X +B X +C X +A Z +B Z +A X +B Z +A Z +B X +B X +C Y +B Z +C Y +A Z +B Z +B X +A Z +C Y +B X +B Y +B Z +C Y +B X +C Y +B X +A X +A X +C Y +B X +B X +A Y +A Z +A Z +B Z +A Z +C Y +C Y +A Z +A X +A Z +B X +C Y +C X +A Z +A X +B Z +B Z +A X +B X +C X +C Y +C Y +B Z +B X +C Y +C Z +B Y +C Y +A Z +B Z +B Z +B X +B X +C Y +B X +B X +C X +A X +B Z +C Y +B Y +B X +A Z +B Z +B X +A Z +B Z +B X +A Z +B X +C Y +C X +B Y +B Y +B Z +C Y +A X +B Z +B Y +C Y +A X +B Z +B Z +C X +B X +C Y +C Y +C Y +C Y +A Z +A Z +B X +B X +C Z +B X +B Z +B X +B Z +A Z +B X +C Y +B X +C Y +C Y +A X +B X +A X +C X +B X +B Y +A X +B Z +A Z +B Y +B Z +C Y +B Z +C Y +B X +B Z +B Y +B X +B X +A Z +B Z +B X +A Z +C Y +C Y +A Z +A X +C Z +A X +B Z +B Z +C Y +B X +B X +A Y +B Z +C X +C Y +C Y +C Y +A Y +A X +B X +B Z +A Z +B X +C X +C X +C Y +C Y +C Y +B X +B X +A Z +B Z +B X +A X +A Z +C Z +B Z +B Z +B X +A X +B X +C Y +B Z +A X +B Y +B Z +B Y +B X +A X +B Z +C Y +C X +C Y +A Z +B Z +B X +B Z +B X +A Y +B X +A Z +B X +C X +A X +C Y +B X +C Y +C Y +A Y +C Z +A Z +C X +B X +C Y +A Z +B X +B Z +B Z +C Y +A X +A Z +B X +B X +B Z +B X +C Y +B X +A X +A X +C Y +A Z +C Y +B Y +B Z +B Z +C Y +B Z +C Y +B X +B X +B Y +C Y +A X +A Z +A Z +A X +C Y +B X +B Y +B Y +B X +A X +A Y +B Y +B Y +C Y +A X +B Z +C Y +A Z +C Y +B Y +A X +B X +A X +B X +A Z +C Y +C Y +A X +B Y +B Y +B X +A Z +A Z +A Z +A Y +B Z +C X +B X +C Y +C Z +B Y +C Y +C X +B X +B Z +B Z +B Z +B Z +B Y +B Z +A Z +C X +B X +C Y +C Y +B Z +C Y +C Y +A X +C X +A X +B Z +C Y +B X +C Y +A X +A Z +C Z +A X +B Z +C Y +C Y +C Y +A X +C Y +C Y +B X +B X +B Y +C Y +B Z +B X +C Y +A Z +C X +A Z +C Y +A Z +A X +B Z +B X +C Z +B X +C Y +A Z +C Y +B X +B X +B X +B Z +C Y +B X +A Z +A Z +C Y +B Y +C Y +B Z +A Z +A X +B Z +B X +B X +A Y +B X +B X +C Y +B X +B X +B Z +C Y +B X +A X +A Z +A Z +C X +A X +A X +B X +B X +B Z +A X +C Y +B X +C Y +C Y +A X +B X +A X +A Z +A Z +C Y +B X +C Y +B Y +B X +B X +C X +B X +A X +C X +B Z +C Y +B Z +B X +C Y +C Y +A Z +C Y +B Z +B X +A Z +C Y +C Y +B X +B Z +A X +B X +C Y +C Y +C Y +A X +A X +A X +B Z +B Z +A X +A X +B X +B Z +C Y +C Y +B Z +A Z +C Y +C Y +A Z +B Z +C Y +B X +B X +B X +C Y +C Y +B Z +C Y +B Z +A X +A X +B X +C Y +A X +A X +C X +A Y +C X +B X +B X +B Z +B Z +B Z +B X +B Z +C Y +C Y +C X +A Z +B X +A X +B Z +B X +A Z +C Y +B X +B Y +B Z +A Z +B X +A Y +C X +B X +C Z +C Y +B Z +A X +B Z +B Z +A X +B Z +B X +C Y +B Z +C X +C Y +A Z +C Y +A Y +B Z +B X +B Y +A Z +A Y +A X +B Y +A Z +B Z +C Y +C Y +C X +C Y +C Y +B X +B Z +A Z +B Z +B Z +A Z +C Y +A Z +C X +C Y +C Y +C Y +A X +C Y +B Z +A X +C Y +C Y +C Y +B X +B Z +B Y +C Y +C Y +C Y +C Y +B Y +A Y +B Z +B X +A X +A Y +C Y +C X +B X +B Z +A Z +B Z +B X +A X +C Z +C X +B Z +C Y +A X +C X +B Z +B X +B X +A Z +B X +B Z +B Y +C Y +B X +A X +B X +B Z +A X +B Z +A Y +C Y +A X +C X +B X +B Y +B Z +B X +B X +C Y +B X +B X +C Y +B Y +B Z +B Y +B Z +C Y +A Z +C Y +A Z +B X +B X +A Z +B X +C Y +C X +C Y +B Y +C Y +C Y +C Z +C Y +A Y +C Y +B X +B Z +A Y +B Z +A Z +B Z +B Z +B X +B Y +C Y +B X +C Y +C Z +C Y +A X +B X +B X +C Z +A Z +B X +A Z +C Y +B Z +B Z +B Y +A Z +B Z +C Y +C Y +A Z +C Y +B Y +C Y +B Z +C X +B Z +B X +A Z +B Y +B Y +B Z +A Z +B Z +C X +C X +B Z +B X +C Y +B X +A X +B X +B X +B Z +C Y +A Z +A Y +B Z +C Y +A X +A X +A Y +B X +B Z +A X +B X +C X +B X +B Y +B X +A Z +C Y +A X +C Y +A X +C Y +C Y +B Y +C Y +B X +C Y +C Y +B X +B Z +A X +C Y +C X +C X +C Y +B Y +A Z +C Y +A X +A X +B X +B X +A X +B X +C X +B Z +B X +A X +A Z +B X +C Y +C Y +A X +C X +B Z +B Z +B X +C Y +C Y +A Z +C X +B Z +C Y +B Y +A Z +B Z +A Z +B X +C X +C Z +C Y +A Z +B Z +B X +C Y +C Y +C X +C Y +C Y +C Y +A X +A Z +C Y +B X +B X +B Z +A Z +C Y +B X +A Z +C Y +C Y +B Z +A X +B Z +B Z +B X +B Z +B X +B X +B Z +B Z +C Y +A X +A X +A Z +C Y +C Y +B X +B Z +C Z +B X +C Z +C Y +C X +C Y +B Y +A X +B Z +A Z +C X +B X +C X +A Z +A Y +B Z +A X +A X +A Z +A Z +B Y +B Z +C Y +B X +C Y +B Z +B X +C Y +C Y +A X +A Z +B X +C Y +B X +B X +A X +A Z +B X +B X +B Z +A X +A X +B Z +B X +B X +B X +A Z +C X +B X +B X +B X +B Z +B X +C X +C Y +A Z +C X +A Z +C Y +A X +C Y +A X +B X +A Z +B X +C Y +C Y +A Z +A Z +B Z +B Z +B X +C X +A X +B Y +B Z +C Y +B Z +A X +A X +B X +A X +A X +A X +A X +B Z +B Y +C Y +A Z +C Z +C Y +A X +B Y +C X +A Z +B X +B Z +A X +A X +C Y +B X +B X +A X +A Z +C Y +C Y +A Z +C Y +B X +B X +A Z +A Y +C Y +A Z +A X +C Y +B Z +B Z +C Y +B X +C Y +C Y +C Y +C Z +B X +C Y +C X +B Z +A Z +C Y +A Z +B Z +A Z +B X +A X +A Z +B Z +B Z +A X +B Z +A X +B X +A Z +B X +B X +A Z +C Y +B X +B Z +C Y +B Z +B Z +B X +B Z +B X +B X +C Y +B X +B Y +B X +B X +A Z +B X +C Y +B X +B X +B X +B Z +A Z +B Y +B X +B Z +C X +C Y +B X +B Y +C Y +B X +C X +B X +C X +B Z +A Y +A Z +B Z +B Z +A X +A Z +B Z +B X +A Z +B Z +C Y +C Z +C Y +A Z +C Z +A Z +C Z +C Y +A Z +A Y +C Y diff --git a/resources/2022/02/test.txt b/resources/2022/02/test.txt new file mode 100644 index 0000000..db60e36 --- /dev/null +++ b/resources/2022/02/test.txt @@ -0,0 +1,3 @@ +A Y +B X +C Z diff --git a/resources/2022/03/input.txt b/resources/2022/03/input.txt new file mode 100644 index 0000000..cd857ef --- /dev/null +++ b/resources/2022/03/input.txt @@ -0,0 +1,300 @@ +jNNBMTNzvTqhQLhQLMQL +VCwnVRCGHHJTdsLtrdhrGdsq +wFJZTbRcnJCbpwpFccZCBfBvPzfpgfgzzWvjSzNP +wDWgDfWNTvwvgFfWfddGldJVprrrVdNlrN +nLnmLSnmMVJvSrHqdV +MsmsbLvtzMjFsCPDsfBwwT +WTqSCqWSWqSgVZqJHpHmHrhMMVrRhBnn +PtLGLGddGGMCpprM +jFvLPPlLjvfjjffsclvPqzzJWTbqNSWZsbSTDzCW +lLSSrfmddlNpnmLdfSPddDdbZQTZgZjbZgjcQZHQPjQgZP +MJMnhzBJVJwvGsMRhRhTsHTjZjHFctbtHZcgZj +vzvBWGJMVGwWGGhGqVBnGzVGDfCDmrqNfrrLSdpSfLSpNmNC +qGWLgfbWhqpLgZbJvTRWJTvMWRslMv +FQwPwNPCV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TQDrSrJfHJgqhgJqzhJJmWfHpWpzmg +twCdCWMLwbtLLjBddgfcJgRHfRRpfcpRHM +FZdbvFFbVvsWsQsW +rzrRgqGrwgjRVqJCHLzCCWhtDbCC +dTZnNpvBvnJdBpBnsJPvsSCbthLtLbbQShQQLHtSST +BlplPmdlFsslfJmmRfwfwMjw +PPHSrmfHTnmHnHBzRhbFgfbFwzQg +LcsVsGtVLtLqpzwBvgzQRgTTTp +TjLJGTTJWJZZWWZS +tHcshJcJRhLsQscVtccJLRHfvlPjZFSvmvSbvfLFfFFbGZ +drwdTNlwwBTpCdCdwGPrrmjjmjmbSjFPrF +wglnzCDpJtQcztMR +bbMjTbBvgjZNSqldTlVt +wwrcFwsrsnnCQzrCsLnRsQZcNlpJVZHdttZVttSZqJZd +GwLnrsmFCCzqzhvPbPmWmvvfjj +dcnwQdcdrJdSwSFBBqfBfwMqfBfzsh +RgmZpWlCClRlTgBZbhHJJsZjfBHZ +DlNVWgWpgDCCNRDJFcrtQGrrVnrcFPtc +sWSHsdSrHWHsbdsddBsbjmfwffmJDJwcfDQgfvwJDj +ZNGPhRqCCRNGNwSDvmmwwgDhgf +lGlTLTGTSVVFqVTqsFHWntbWBsBsnBHb +QRRgRvDwWDVjmSbDnbTDlDnbqS +rHCPPHrcLFJcllqbTlpq +CldFrNFsgVhhhWgN +qSfMgNqfpmSmlQrRFG +cbBczbtbZTcPWzcrTrmRrLGFTQQFmJ +PBZChtzzcWPcZtBvPjtzBBCfHMMNdDgDpMfVfVpHMqNR +LJPPCHtgtLDfFfvTLwfv +pVGWGGjjjplhpGGVjWnldsvrrMFvfDMTWBdFrfFF +cjlhShjchhjGGmNVjplcQgmTPtHPPJmQgQHgtqgZ diff --git a/resources/2022/03/test.txt b/resources/2022/03/test.txt new file mode 100644 index 0000000..f17e726 --- /dev/null +++ b/resources/2022/03/test.txt @@ -0,0 +1,6 @@ +vJrwpWtwJgWrhcsFMMfFFhFp +jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL +PmmdzqPrVvPwwTWBwg +wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn +ttgJtRGJQctTZtZT +CrZsJsPPZsGzwwsLwLmpwMDw diff --git a/resources/2022/04/input.txt b/resources/2022/04/input.txt new file mode 100644 index 0000000..4cfdc23 --- /dev/null +++ b/resources/2022/04/input.txt @@ -0,0 +1,1000 @@ +99-99,18-99 +2-86,1-86 +9-21,10-22 +1-24,7-23 +33-37,35-38 +15-57,14-56 +1-88,3-89 +26-56,27-57 +11-94,93-98 +40-92,3-91 +6-90,5-93 +1-5,9-54 +81-81,20-80 +19-19,20-99 +52-96,52-97 +8-86,85-86 +15-93,92-93 +32-41,33-41 +90-90,23-90 +6-57,56-58 +62-84,63-83 +10-85,11-86 +1-55,54-55 +18-25,24-24 +60-98,59-98 +6-74,7-72 +51-53,52-87 +73-99,14-97 +59-87,7-60 +43-89,42-88 +88-88,79-87 +39-39,21-39 +2-79,1-1 +56-56,56-96 +46-90,47-91 +14-48,48-48 +2-2,2-11 +57-57,4-57 +87-87,1-88 +24-85,85-93 +2-2,3-96 +47-49,47-48 +90-90,29-89 +96-99,15-97 +11-28,12-33 +12-81,6-80 +18-85,85-86 +42-71,41-52 +21-84,22-98 +5-73,7-87 +5-55,55-68 +9-82,10-83 +16-16,16-71 +6-64,6-65 +56-90,90-90 +49-66,36-99 +48-85,52-88 +21-21,21-23 +49-55,4-48 +17-90,50-91 +53-95,52-96 +28-28,33-53 +1-97,1-64 +28-70,27-27 +87-87,29-88 +26-91,72-90 +21-57,22-86 +76-91,75-90 +33-92,32-93 +57-91,58-92 +18-78,17-17 +38-38,38-67 +15-98,61-96 +56-70,56-56 +57-76,57-75 +75-75,67-76 +23-67,22-67 +19-97,98-98 +21-65,20-65 +36-54,33-35 +2-88,1-88 +41-80,6-80 +4-98,4-27 +93-98,4-92 +14-69,13-14 +59-86,86-87 +29-33,17-30 +3-68,2-67 +22-98,6-20 +38-87,38-86 +3-97,97-97 +99-99,24-89 +62-63,47-63 +84-86,1-85 +79-92,91-93 +55-70,54-55 +33-38,28-32 +17-61,5-71 +25-70,69-87 +28-80,11-79 +17-51,29-52 +88-89,18-89 +46-98,21-57 +3-77,77-77 +36-71,23-70 +91-92,50-91 +36-61,37-37 +15-51,14-51 +20-31,30-94 +1-2,1-99 +76-87,76-86 +32-75,32-33 +21-27,20-21 +38-77,11-77 +13-15,14-42 +20-21,21-53 +76-95,77-96 +41-41,48-53 +72-82,71-81 +14-68,91-99 +41-82,83-83 +13-13,12-51 +26-96,27-93 +2-92,93-93 +1-40,4-39 +10-66,11-84 +9-10,9-94 +37-67,70-84 +11-69,8-68 +15-81,16-81 +75-89,82-95 +81-81,1-80 +7-99,99-99 +16-62,49-62 +25-90,25-89 +19-78,18-86 +56-62,59-63 +50-52,4-22 +1-6,7-85 +30-31,31-51 +40-50,50-50 +73-98,72-72 +84-87,72-98 +81-81,4-80 +14-61,11-61 +12-13,13-72 +28-30,18-40 +37-67,37-96 +2-98,3-98 +6-34,33-65 +18-37,18-85 +6-78,6-39 +21-43,44-71 +24-24,23-74 +46-85,46-86 +18-54,1-54 +39-96,28-38 +13-89,89-89 +74-99,75-97 +47-92,38-91 +13-13,14-71 +76-78,77-96 +11-77,76-76 +5-76,4-75 +5-25,24-99 +27-96,20-28 +32-76,32-75 +28-57,2-29 +1-96,99-99 +18-30,31-48 +84-84,17-84 +21-41,4-22 +12-31,12-78 +27-51,41-52 +13-74,73-94 +2-6,6-44 +54-90,90-90 +16-19,18-56 +8-96,11-97 +74-75,70-75 +1-80,2-80 +5-22,5-32 +31-50,30-34 +20-95,17-17 +11-19,20-84 +62-62,39-62 +18-34,33-98 +23-35,37-59 +92-92,10-92 +43-67,24-78 +56-56,28-56 +36-95,36-94 +9-63,17-64 +62-93,84-94 +6-63,5-62 +9-10,2-9 +55-64,64-96 +31-90,31-37 +11-92,10-91 +27-95,10-95 +52-65,52-66 +87-87,80-87 +4-46,45-45 +45-45,32-45 +33-96,96-97 +40-60,41-65 +24-24,21-25 +19-85,4-32 +22-93,92-94 +97-99,2-97 +47-84,6-83 +95-97,5-95 +23-49,21-24 +57-59,58-75 +44-44,45-97 +3-9,7-14 +1-70,2-71 +11-85,12-12 +14-59,3-13 +71-91,35-90 +2-89,1-88 +3-93,3-96 +28-30,27-29 +14-37,1-15 +14-89,13-15 +4-63,19-63 +2-18,18-48 +37-98,31-98 +5-5,6-95 +52-52,53-73 +75-78,78-78 +1-99,99-99 +44-69,68-69 +83-83,49-83 +29-73,6-29 +87-87,88-93 +6-93,1-7 +12-93,13-94 +2-27,2-81 +34-83,5-82 +95-99,5-96 +60-74,45-56 +19-81,18-80 +10-68,8-67 +15-98,46-54 +49-93,48-92 +11-65,64-64 +97-97,1-97 +41-86,42-94 +32-47,3-47 +2-64,1-85 +68-75,72-86 +1-89,6-44 +3-88,2-87 +19-50,18-20 +8-39,4-7 +15-86,15-86 +74-74,36-74 +25-48,26-49 +36-98,35-98 +73-75,38-74 +11-52,11-39 +17-75,16-88 +3-96,2-95 +23-48,6-47 +29-37,21-73 +4-91,91-91 +31-95,31-32 +30-90,30-89 +11-64,65-65 +12-72,13-72 +84-84,16-83 +9-77,5-9 +72-98,38-41 +37-80,36-36 +48-48,47-98 +61-73,62-74 +46-53,45-47 +8-93,2-93 +35-61,35-40 +7-16,15-16 +67-79,21-68 +93-99,61-94 +9-23,3-9 +66-87,26-87 +97-99,97-97 +2-21,21-22 +1-84,2-84 +36-87,86-87 +92-94,7-93 +50-97,44-50 +19-69,18-88 +44-57,31-66 +87-87,79-87 +56-85,55-55 +42-93,80-94 +6-66,6-67 +9-82,9-10 +53-60,52-59 +23-86,17-24 +6-44,43-72 +52-66,1-88 +3-88,3-34 +35-75,75-96 +39-54,37-37 +2-41,23-42 +56-56,6-55 +31-32,32-57 +61-61,8-61 +55-96,95-96 +32-76,14-75 +9-44,13-70 +9-30,31-31 +6-96,2-6 +26-53,23-23 +23-80,79-81 +6-65,17-65 +23-32,35-97 +57-66,57-68 +13-60,13-14 +30-52,18-29 +33-46,33-45 +45-69,46-68 +71-96,97-99 +58-60,18-59 +29-30,29-95 +34-37,37-70 +5-90,6-90 +52-96,24-37 +10-79,65-82 +3-80,81-81 +66-93,94-95 +6-25,6-72 +8-9,9-98 +6-98,4-7 +26-80,19-23 +75-75,7-75 +8-92,11-93 +13-96,12-98 +64-66,28-65 +23-93,47-96 +62-75,53-60 +42-42,34-43 +1-66,2-65 +22-46,21-46 +2-4,4-83 +8-9,8-41 +68-91,90-92 +61-94,95-95 +44-66,35-67 +25-94,93-95 +71-88,69-86 +5-48,5-47 +17-81,52-81 +4-84,1-3 +73-73,72-72 +87-87,26-86 +83-83,14-83 +12-88,11-12 +9-9,10-84 +14-88,15-89 +66-77,78-85 +64-85,94-99 +81-82,48-81 +1-93,1-94 +11-98,11-12 +52-89,37-89 +35-69,69-91 +25-59,24-59 +9-42,1-1 +94-97,90-97 +49-93,48-61 +24-24,25-76 +5-14,14-64 +12-83,29-84 +16-68,16-83 +43-48,38-49 +46-79,4-45 +74-94,34-65 +33-45,24-61 +3-82,15-83 +26-54,82-88 +63-63,38-62 +16-97,15-97 +7-88,1-98 +91-96,3-87 +28-45,44-44 +36-77,14-77 +25-81,82-82 +28-28,27-77 +6-33,32-49 +14-34,3-15 +13-98,12-94 +5-11,9-12 +54-56,13-55 +26-90,25-93 +67-88,87-89 +76-98,75-99 +1-85,1-65 +54-70,55-71 +53-87,52-86 +6-92,2-7 +38-90,91-98 +52-67,51-67 +74-93,20-74 +3-87,2-86 +7-27,26-26 +91-97,88-96 +17-25,16-24 +4-91,4-92 +43-56,44-44 +4-79,3-80 +37-95,36-96 +5-19,18-34 +9-58,73-73 +23-27,23-27 +68-70,69-96 +3-78,2-51 +6-94,7-73 +93-96,76-93 +88-99,20-88 +11-89,90-96 +5-98,99-99 +23-34,33-93 +10-23,5-22 +44-44,45-93 +2-98,2-97 +64-96,59-64 +13-13,14-98 +21-94,44-99 +71-95,94-94 +56-98,55-98 +18-66,19-67 +3-92,3-93 +74-93,69-69 +68-68,14-67 +45-97,74-98 +21-89,46-91 +10-91,11-74 +14-41,5-45 +3-39,39-80 +20-75,20-76 +21-92,15-20 +27-28,26-36 +57-75,57-80 +18-87,17-86 +23-57,22-56 +63-82,59-80 +99-99,1-97 +94-94,14-93 +22-82,21-98 +68-75,41-67 +39-77,38-76 +7-68,68-68 +15-18,18-79 +79-89,78-80 +26-68,26-51 +31-77,3-32 +29-97,11-11 +4-91,4-63 +8-90,8-98 +36-58,23-58 +14-46,13-34 +37-97,37-98 +4-4,5-21 +20-89,19-89 +42-43,43-87 +49-50,48-48 +20-86,98-98 +12-19,12-16 +58-59,40-58 +48-79,47-48 +97-99,32-98 +22-98,7-23 +16-88,17-83 +68-96,97-98 +11-50,30-64 +1-96,2-97 +44-96,44-97 +66-66,7-66 +9-42,10-42 +89-93,48-90 +6-7,6-64 +90-92,8-91 +8-12,13-74 +25-64,25-65 +62-70,63-72 +3-99,8-73 +2-79,1-78 +98-99,3-97 +35-76,6-75 +74-78,73-73 +87-97,64-87 +17-91,16-91 +2-71,8-72 +79-95,32-93 +34-97,24-35 +85-87,46-86 +36-72,72-73 +4-7,7-79 +10-11,10-80 +88-89,7-89 +15-52,52-52 +33-65,64-86 +46-48,48-63 +25-40,24-24 +53-81,11-53 +8-9,9-94 +97-97,19-97 +4-84,84-95 +22-41,40-59 +20-55,56-99 +9-46,47-47 +2-4,3-88 +31-73,30-30 +26-87,12-22 +3-45,1-44 +7-24,7-83 +11-81,8-80 +13-16,10-15 +18-44,43-44 +3-4,4-78 +87-91,2-87 +2-89,22-89 +11-93,10-10 +6-99,1-99 +12-95,12-94 +26-58,39-97 +52-98,52-97 +49-71,50-85 +41-49,41-45 +37-89,38-90 +2-90,4-80 +42-92,95-98 +58-82,57-82 +25-70,6-71 +42-96,44-96 +21-21,20-95 +9-97,8-99 +20-21,12-21 +44-93,97-98 +44-98,45-64 +19-19,18-93 +65-65,66-72 +8-42,3-7 +12-83,11-82 +19-75,63-76 +32-60,32-32 +12-90,90-99 +59-60,17-59 +8-75,7-31 +59-79,58-79 +14-83,15-84 +28-29,28-30 +60-98,1-98 +33-45,33-64 +20-20,20-20 +36-94,35-93 +13-31,31-31 +28-30,2-29 +81-81,82-86 +76-78,79-79 +54-80,54-70 +61-64,65-99 +5-11,11-89 +16-54,17-26 +2-56,2-3 +42-76,77-77 +7-82,7-81 +37-54,19-38 +77-96,71-76 +16-85,84-86 +8-93,1-9 +37-87,36-77 +54-71,19-71 +20-29,20-97 +82-96,83-96 +48-81,47-81 +4-36,5-37 +8-59,7-9 +91-99,62-98 +12-80,86-90 +25-95,24-25 +32-94,94-94 +22-97,98-98 +16-92,16-17 +84-84,74-84 +4-86,2-85 +23-56,23-57 +31-31,32-99 +14-96,13-15 +50-81,34-41 +11-44,11-11 +7-38,6-38 +10-77,10-96 +50-86,87-87 +5-87,5-86 +91-91,42-90 +19-97,97-97 +22-77,21-27 +7-7,6-81 +79-93,18-92 +39-93,59-98 +1-84,84-84 +30-35,30-48 +1-2,3-47 +4-88,3-5 +4-90,90-91 +3-95,4-98 +28-31,5-32 +39-93,4-98 +99-99,1-99 +4-96,3-95 +58-63,58-63 +44-91,33-44 +27-27,28-89 +16-84,78-85 +2-22,17-23 +30-78,77-84 +17-57,18-57 +2-99,1-3 +2-31,35-43 +74-74,17-75 +46-92,87-93 +6-97,5-96 +4-18,19-90 +31-33,32-57 +26-57,27-58 +3-78,1-1 +68-69,34-69 +66-66,26-66 +11-12,14-61 +5-6,5-76 +14-96,96-97 +4-70,4-69 +69-95,70-70 +8-93,5-8 +35-87,1-35 +51-62,51-61 +52-69,51-51 +14-69,24-70 +20-91,80-90 +74-88,75-88 +3-72,1-72 +7-67,6-65 +31-47,32-48 +99-99,11-98 +7-17,7-14 +55-88,56-99 +29-31,28-30 +65-65,66-66 +9-76,33-73 +51-72,19-52 +2-15,2-98 +78-78,24-77 +41-95,96-96 +23-94,22-23 +23-24,24-97 +34-34,35-94 +7-81,7-39 +9-17,16-91 +11-23,10-10 +17-66,67-70 +28-68,27-27 +65-91,90-98 +43-79,11-44 +15-83,48-82 +13-84,13-83 +5-5,7-71 +48-63,49-64 +75-76,28-76 +23-95,23-23 +18-95,19-96 +45-86,87-87 +2-29,30-82 +15-66,14-66 +23-94,94-97 +15-88,19-74 +1-44,13-45 +24-25,24-45 +43-49,54-67 +6-63,5-63 +70-99,70-92 +45-95,76-96 +78-96,98-98 +3-3,5-75 +3-75,2-81 +15-19,11-39 +47-70,54-70 +6-92,6-91 +39-88,40-89 +1-76,66-93 +89-89,4-88 +18-94,8-18 +6-81,7-66 +87-94,88-90 +10-29,30-30 +6-73,3-77 +80-84,79-81 +47-48,47-53 +44-61,44-57 +53-60,52-61 +56-65,56-66 +25-52,52-74 +5-6,7-93 +22-99,21-22 +3-14,2-12 +4-42,1-4 +22-85,23-86 +25-56,33-56 +16-84,84-85 +51-57,9-50 +8-91,90-90 +30-85,19-31 +15-66,46-67 +17-31,16-31 +24-94,23-24 +54-54,55-84 +41-98,42-96 +89-89,42-88 +25-72,26-45 +25-96,6-97 +6-85,3-6 +71-78,43-72 +3-74,3-73 +5-49,8-50 +5-5,6-86 +4-39,39-73 +85-87,84-86 +11-62,10-78 +61-86,62-85 +7-32,32-60 +79-79,10-79 +17-72,38-73 +13-86,12-85 +6-6,2-4 +47-49,1-48 +74-98,12-99 +1-71,1-27 +29-80,29-81 +54-94,53-94 +18-74,73-82 +95-95,7-95 +62-62,62-62 +6-93,7-94 +43-87,43-98 +17-89,9-93 +4-72,1-3 +22-45,45-95 +2-2,3-92 +75-77,29-74 +11-98,97-98 +70-70,69-69 +36-41,35-36 +6-12,10-13 +65-98,65-99 +1-97,2-98 +33-89,12-89 +24-69,18-18 +3-65,2-66 +14-14,15-80 +18-70,2-5 +8-59,9-60 +52-53,8-53 +72-89,39-72 +18-81,82-82 +1-95,1-94 +57-73,92-99 +10-20,9-19 +44-68,56-68 +18-22,19-27 +28-65,28-38 +63-87,47-86 +8-87,9-88 +26-55,25-95 +28-96,13-27 +38-38,6-37 +33-37,40-73 +72-95,95-95 +61-93,28-53 +73-85,86-86 +2-93,94-94 +42-97,43-43 +12-99,11-13 +11-94,12-86 +63-87,86-87 +47-48,46-47 +91-91,7-91 +8-21,22-45 +49-57,50-58 +10-11,11-91 +41-47,36-47 +30-64,30-65 +1-28,24-24 +3-12,1-3 +60-76,57-59 +15-65,16-16 +64-64,5-64 +7-99,6-6 +48-98,69-99 +97-99,1-97 +66-66,10-67 +5-99,4-99 +32-86,85-88 +2-99,2-2 +3-35,35-44 +62-62,37-61 +5-53,4-54 +1-98,98-99 +31-98,48-99 +3-5,4-88 +47-54,36-53 +44-91,69-92 +52-65,66-98 +10-72,62-71 +6-98,6-97 +53-53,54-80 +2-96,2-52 +10-17,11-94 +25-90,25-30 +55-71,55-70 +44-66,66-67 +83-87,82-87 +34-76,1-34 +35-38,41-54 +64-98,1-98 +58-58,58-71 +56-89,89-99 +55-73,37-79 +15-97,18-22 +4-97,4-98 +8-62,34-95 +1-4,5-51 +37-65,51-95 +22-87,51-87 +29-40,28-28 +21-83,21-83 +24-26,25-46 +23-68,24-69 +69-77,78-78 +42-92,41-72 +37-78,28-77 +2-90,2-89 +5-9,8-50 +4-82,3-89 +47-49,48-82 +10-99,11-94 +19-42,10-18 +15-48,7-16 +21-86,21-22 +69-69,38-69 +24-27,32-92 +30-94,30-78 +35-36,35-56 +85-87,86-86 +70-70,71-97 +7-7,8-84 +7-83,83-83 +9-87,10-88 +1-14,13-92 +2-93,92-94 +37-45,45-84 +6-98,5-94 +5-74,2-4 +5-23,23-57 +14-77,3-76 +5-84,3-83 +22-52,12-52 +18-71,19-72 +13-91,13-90 +95-95,19-95 +4-39,3-38 +5-71,2-3 +52-52,3-53 +4-81,2-3 +77-98,49-98 +48-48,37-47 +13-86,14-86 +9-99,10-99 +89-98,22-89 +66-73,66-80 +12-12,13-98 +4-5,6-23 +79-99,79-80 +40-72,4-41 +70-74,69-76 +15-16,16-37 +22-78,1-96 +66-79,66-80 +2-92,92-93 +80-95,81-90 +34-37,32-37 +17-34,30-49 +16-98,26-99 +11-12,11-23 +2-72,72-72 +48-50,31-54 +75-90,75-82 +4-20,21-26 +3-3,2-85 +1-58,2-59 +3-94,3-95 +55-87,54-86 +22-81,33-80 +14-80,15-15 +3-71,71-72 +60-60,60-70 +25-25,25-95 +20-62,20-61 +64-84,84-84 +5-98,5-98 +3-10,12-71 +55-77,55-74 +12-79,78-79 +23-36,23-35 +16-42,42-42 +27-85,26-26 +3-71,71-71 +87-94,29-86 +2-78,77-79 +22-86,22-85 +7-84,8-85 +63-67,64-70 +28-45,28-29 +23-74,74-75 +6-50,50-74 +49-68,51-59 +50-50,49-63 +7-7,7-83 +11-53,54-54 +5-89,5-89 +7-88,6-87 +8-58,9-58 +5-6,5-71 +16-79,7-17 +98-98,24-96 +49-49,48-86 +20-64,40-96 +50-89,90-90 +13-72,14-72 +69-70,69-93 +13-96,12-99 +21-47,36-47 +34-34,19-34 +3-82,5-83 +26-46,27-47 +39-91,6-88 +8-97,8-92 +7-8,7-82 +80-81,37-80 +33-44,99-99 +17-36,7-18 +7-99,98-98 +36-78,77-79 +24-67,24-66 +1-68,9-67 +60-60,61-90 +90-91,42-90 +3-94,3-95 +16-96,16-82 +2-4,5-92 +6-93,7-87 +2-4,4-44 +62-77,57-77 +3-99,64-99 +28-89,27-27 +53-53,26-52 +14-76,61-77 +33-94,32-33 +37-42,38-42 +94-95,55-68 +34-58,3-35 +13-48,35-45 +4-54,3-99 +11-12,11-97 +27-88,95-99 +32-92,33-74 +21-72,6-21 +2-98,2-99 +5-96,4-96 +1-67,7-49 +53-89,11-12 +30-36,29-34 +73-96,72-96 +31-68,16-31 +31-51,50-59 +90-98,76-93 +3-61,3-61 +42-47,8-28 +10-85,9-10 +50-51,51-82 +83-90,76-89 +2-70,3-21 +46-74,46-76 +4-67,1-3 +1-94,94-94 +2-4,3-51 +12-51,5-12 +18-32,18-33 +29-84,15-83 diff --git a/resources/2022/04/test.txt b/resources/2022/04/test.txt new file mode 100644 index 0000000..9f9e9cf --- /dev/null +++ b/resources/2022/04/test.txt @@ -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/resources/2022/05/input.txt b/resources/2022/05/input.txt new file mode 100644 index 0000000..85131c9 --- /dev/null +++ b/resources/2022/05/input.txt @@ -0,0 +1,511 @@ + [L] [M] [M] + [D] [R] [Z] [C] [L] + [C] [S] [T] [G] [V] [M] +[R] [L] [Q] [B] [B] [D] [F] +[H] [B] [G] [D] [Q] [Z] [T] [J] +[M] [J] [H] [M] [P] [S] [V] [L] [N] +[P] [C] [N] [T] [S] [F] [R] [G] [Q] +[Z] [P] [S] [F] [F] [T] [N] [P] [W] + 1 2 3 4 5 6 7 8 9 + +move 7 from 3 to 9 +move 5 from 8 to 9 +move 3 from 9 to 5 +move 6 from 9 to 2 +move 9 from 9 to 3 +move 3 from 7 to 3 +move 8 from 2 to 3 +move 9 from 3 to 1 +move 11 from 3 to 8 +move 5 from 6 to 9 +move 1 from 6 to 3 +move 1 from 2 to 7 +move 1 from 4 to 8 +move 1 from 3 to 9 +move 4 from 4 to 3 +move 6 from 8 to 3 +move 2 from 8 to 2 +move 4 from 9 to 3 +move 3 from 2 to 5 +move 2 from 5 to 4 +move 5 from 3 to 4 +move 11 from 1 to 4 +move 1 from 7 to 6 +move 1 from 3 to 5 +move 2 from 1 to 9 +move 1 from 1 to 4 +move 7 from 5 to 8 +move 21 from 4 to 6 +move 6 from 6 to 2 +move 6 from 8 to 9 +move 5 from 8 to 5 +move 2 from 2 to 7 +move 4 from 3 to 7 +move 1 from 2 to 6 +move 1 from 2 to 5 +move 2 from 2 to 7 +move 4 from 3 to 7 +move 1 from 4 to 6 +move 9 from 5 to 3 +move 7 from 3 to 4 +move 7 from 7 to 3 +move 7 from 4 to 1 +move 8 from 3 to 5 +move 1 from 3 to 5 +move 3 from 8 to 2 +move 2 from 2 to 9 +move 13 from 9 to 4 +move 5 from 5 to 3 +move 4 from 7 to 6 +move 1 from 7 to 4 +move 2 from 4 to 2 +move 3 from 3 to 4 +move 2 from 5 to 2 +move 6 from 1 to 7 +move 1 from 2 to 8 +move 1 from 3 to 8 +move 1 from 1 to 6 +move 1 from 3 to 4 +move 1 from 2 to 6 +move 24 from 6 to 1 +move 3 from 2 to 3 +move 3 from 3 to 5 +move 2 from 8 to 6 +move 2 from 5 to 4 +move 3 from 5 to 1 +move 7 from 4 to 8 +move 3 from 8 to 9 +move 2 from 9 to 5 +move 2 from 6 to 3 +move 1 from 9 to 8 +move 5 from 7 to 5 +move 2 from 3 to 1 +move 1 from 7 to 1 +move 7 from 4 to 7 +move 2 from 4 to 8 +move 6 from 8 to 6 +move 3 from 6 to 9 +move 10 from 5 to 1 +move 7 from 7 to 1 +move 1 from 4 to 9 +move 1 from 6 to 3 +move 2 from 9 to 7 +move 1 from 4 to 2 +move 1 from 9 to 5 +move 1 from 8 to 5 +move 39 from 1 to 8 +move 1 from 2 to 5 +move 2 from 6 to 9 +move 3 from 9 to 5 +move 3 from 1 to 6 +move 1 from 7 to 2 +move 1 from 3 to 2 +move 2 from 6 to 2 +move 3 from 2 to 3 +move 1 from 6 to 2 +move 1 from 1 to 8 +move 3 from 1 to 2 +move 3 from 2 to 4 +move 2 from 4 to 5 +move 2 from 3 to 8 +move 8 from 5 to 2 +move 8 from 8 to 2 +move 15 from 2 to 7 +move 1 from 1 to 5 +move 25 from 8 to 7 +move 2 from 2 to 4 +move 2 from 4 to 3 +move 1 from 8 to 4 +move 2 from 4 to 6 +move 1 from 2 to 1 +move 26 from 7 to 2 +move 15 from 2 to 1 +move 7 from 8 to 9 +move 10 from 1 to 6 +move 10 from 7 to 2 +move 1 from 8 to 1 +move 5 from 9 to 8 +move 1 from 8 to 9 +move 2 from 6 to 9 +move 3 from 7 to 1 +move 1 from 7 to 1 +move 5 from 9 to 2 +move 1 from 3 to 1 +move 9 from 6 to 3 +move 1 from 6 to 1 +move 4 from 2 to 4 +move 3 from 4 to 8 +move 1 from 4 to 1 +move 9 from 3 to 1 +move 1 from 7 to 6 +move 9 from 2 to 5 +move 14 from 1 to 6 +move 1 from 3 to 8 +move 5 from 2 to 6 +move 8 from 1 to 8 +move 6 from 6 to 8 +move 14 from 6 to 7 +move 1 from 1 to 7 +move 10 from 5 to 4 +move 11 from 8 to 5 +move 15 from 7 to 1 +move 4 from 5 to 6 +move 4 from 8 to 9 +move 6 from 5 to 3 +move 1 from 6 to 9 +move 1 from 1 to 6 +move 1 from 5 to 8 +move 2 from 6 to 2 +move 6 from 1 to 5 +move 1 from 5 to 8 +move 2 from 5 to 4 +move 9 from 2 to 9 +move 13 from 9 to 8 +move 1 from 2 to 1 +move 1 from 4 to 8 +move 3 from 3 to 1 +move 2 from 4 to 5 +move 2 from 1 to 5 +move 1 from 9 to 3 +move 17 from 8 to 1 +move 3 from 3 to 2 +move 4 from 5 to 1 +move 2 from 2 to 4 +move 1 from 6 to 1 +move 1 from 2 to 8 +move 4 from 4 to 6 +move 1 from 5 to 9 +move 5 from 6 to 8 +move 1 from 5 to 4 +move 1 from 5 to 6 +move 3 from 8 to 6 +move 8 from 4 to 5 +move 32 from 1 to 7 +move 11 from 7 to 6 +move 8 from 5 to 3 +move 3 from 8 to 7 +move 6 from 3 to 9 +move 4 from 3 to 8 +move 5 from 8 to 2 +move 1 from 8 to 5 +move 11 from 6 to 3 +move 1 from 5 to 2 +move 2 from 8 to 6 +move 12 from 7 to 8 +move 2 from 6 to 2 +move 2 from 6 to 4 +move 5 from 2 to 5 +move 8 from 7 to 2 +move 2 from 7 to 1 +move 2 from 7 to 6 +move 5 from 5 to 4 +move 5 from 4 to 7 +move 5 from 8 to 2 +move 2 from 9 to 7 +move 5 from 8 to 4 +move 2 from 7 to 3 +move 2 from 9 to 3 +move 3 from 7 to 9 +move 1 from 1 to 8 +move 2 from 6 to 1 +move 2 from 9 to 8 +move 1 from 7 to 8 +move 1 from 2 to 5 +move 1 from 7 to 9 +move 7 from 4 to 3 +move 3 from 3 to 6 +move 5 from 8 to 6 +move 3 from 9 to 5 +move 16 from 3 to 1 +move 2 from 9 to 1 +move 7 from 1 to 8 +move 1 from 1 to 2 +move 5 from 8 to 2 +move 12 from 1 to 4 +move 1 from 3 to 5 +move 1 from 2 to 9 +move 1 from 9 to 4 +move 4 from 6 to 5 +move 5 from 6 to 1 +move 1 from 6 to 5 +move 1 from 1 to 4 +move 1 from 4 to 7 +move 1 from 3 to 7 +move 9 from 4 to 6 +move 2 from 7 to 8 +move 1 from 3 to 4 +move 2 from 8 to 9 +move 4 from 8 to 4 +move 4 from 2 to 8 +move 2 from 9 to 7 +move 2 from 7 to 8 +move 10 from 2 to 4 +move 1 from 2 to 1 +move 5 from 4 to 7 +move 1 from 1 to 3 +move 3 from 8 to 7 +move 6 from 7 to 2 +move 3 from 2 to 7 +move 1 from 6 to 7 +move 5 from 5 to 8 +move 4 from 1 to 3 +move 4 from 3 to 1 +move 8 from 4 to 2 +move 1 from 3 to 2 +move 2 from 7 to 2 +move 2 from 6 to 3 +move 4 from 7 to 2 +move 4 from 5 to 7 +move 14 from 2 to 7 +move 3 from 2 to 1 +move 3 from 8 to 2 +move 1 from 5 to 7 +move 6 from 2 to 4 +move 2 from 2 to 7 +move 2 from 3 to 6 +move 6 from 8 to 2 +move 4 from 6 to 4 +move 2 from 6 to 9 +move 4 from 4 to 2 +move 2 from 4 to 8 +move 10 from 7 to 2 +move 18 from 2 to 6 +move 2 from 2 to 6 +move 2 from 9 to 2 +move 2 from 8 to 5 +move 1 from 2 to 9 +move 1 from 2 to 9 +move 1 from 5 to 7 +move 1 from 2 to 6 +move 2 from 9 to 2 +move 6 from 7 to 3 +move 7 from 6 to 8 +move 5 from 7 to 2 +move 1 from 7 to 4 +move 1 from 5 to 7 +move 4 from 8 to 7 +move 5 from 2 to 3 +move 1 from 7 to 5 +move 2 from 2 to 8 +move 9 from 4 to 3 +move 13 from 6 to 8 +move 10 from 3 to 1 +move 1 from 5 to 2 +move 3 from 6 to 8 +move 5 from 1 to 2 +move 1 from 1 to 8 +move 2 from 4 to 3 +move 17 from 8 to 6 +move 5 from 6 to 3 +move 3 from 1 to 2 +move 9 from 6 to 5 +move 2 from 6 to 8 +move 5 from 5 to 9 +move 3 from 9 to 8 +move 3 from 1 to 3 +move 3 from 7 to 5 +move 6 from 5 to 8 +move 7 from 2 to 4 +move 1 from 6 to 3 +move 1 from 1 to 5 +move 4 from 4 to 5 +move 2 from 2 to 9 +move 3 from 1 to 3 +move 4 from 5 to 8 +move 1 from 4 to 5 +move 6 from 8 to 7 +move 1 from 5 to 2 +move 4 from 9 to 2 +move 2 from 5 to 9 +move 2 from 1 to 8 +move 2 from 4 to 9 +move 6 from 7 to 5 +move 3 from 5 to 2 +move 3 from 2 to 5 +move 10 from 8 to 3 +move 2 from 8 to 5 +move 3 from 2 to 5 +move 6 from 5 to 1 +move 4 from 5 to 6 +move 1 from 7 to 5 +move 23 from 3 to 7 +move 2 from 5 to 9 +move 2 from 1 to 5 +move 2 from 6 to 3 +move 6 from 3 to 1 +move 1 from 1 to 7 +move 4 from 3 to 1 +move 1 from 8 to 5 +move 2 from 9 to 2 +move 3 from 3 to 8 +move 2 from 6 to 8 +move 12 from 1 to 3 +move 1 from 9 to 7 +move 3 from 5 to 9 +move 9 from 3 to 8 +move 1 from 1 to 7 +move 1 from 9 to 4 +move 3 from 3 to 6 +move 3 from 2 to 1 +move 3 from 8 to 6 +move 1 from 4 to 2 +move 1 from 2 to 9 +move 1 from 2 to 7 +move 20 from 7 to 5 +move 3 from 7 to 3 +move 3 from 1 to 3 +move 5 from 8 to 1 +move 5 from 1 to 5 +move 4 from 5 to 2 +move 3 from 2 to 6 +move 3 from 8 to 7 +move 1 from 2 to 6 +move 2 from 8 to 6 +move 2 from 7 to 5 +move 2 from 3 to 6 +move 12 from 5 to 1 +move 6 from 5 to 7 +move 12 from 6 to 8 +move 4 from 9 to 3 +move 4 from 5 to 8 +move 3 from 1 to 5 +move 4 from 7 to 4 +move 3 from 5 to 9 +move 7 from 1 to 6 +move 1 from 1 to 3 +move 6 from 7 to 6 +move 1 from 1 to 3 +move 10 from 3 to 6 +move 10 from 6 to 2 +move 2 from 9 to 5 +move 4 from 6 to 5 +move 9 from 6 to 1 +move 16 from 8 to 7 +move 3 from 8 to 7 +move 1 from 8 to 1 +move 7 from 2 to 1 +move 1 from 5 to 9 +move 1 from 6 to 1 +move 2 from 2 to 1 +move 3 from 1 to 4 +move 1 from 6 to 8 +move 7 from 4 to 1 +move 1 from 8 to 2 +move 22 from 1 to 8 +move 18 from 7 to 9 +move 6 from 5 to 2 +move 2 from 2 to 7 +move 2 from 1 to 5 +move 4 from 7 to 6 +move 1 from 5 to 6 +move 2 from 8 to 2 +move 3 from 2 to 6 +move 1 from 5 to 6 +move 15 from 9 to 6 +move 6 from 9 to 5 +move 1 from 9 to 8 +move 1 from 2 to 9 +move 5 from 5 to 9 +move 9 from 8 to 6 +move 3 from 2 to 7 +move 12 from 8 to 9 +move 1 from 7 to 5 +move 1 from 5 to 7 +move 3 from 7 to 1 +move 17 from 6 to 3 +move 1 from 2 to 6 +move 2 from 1 to 4 +move 16 from 6 to 4 +move 7 from 4 to 6 +move 1 from 5 to 7 +move 8 from 4 to 5 +move 9 from 9 to 8 +move 16 from 3 to 7 +move 1 from 1 to 5 +move 3 from 5 to 1 +move 5 from 6 to 2 +move 3 from 1 to 7 +move 3 from 6 to 7 +move 3 from 9 to 3 +move 5 from 8 to 5 +move 11 from 5 to 7 +move 2 from 3 to 7 +move 1 from 2 to 1 +move 1 from 3 to 6 +move 17 from 7 to 9 +move 1 from 3 to 2 +move 3 from 4 to 6 +move 1 from 1 to 2 +move 1 from 6 to 4 +move 14 from 7 to 6 +move 15 from 9 to 6 +move 4 from 8 to 7 +move 1 from 4 to 7 +move 7 from 9 to 5 +move 5 from 2 to 9 +move 7 from 5 to 1 +move 3 from 1 to 7 +move 29 from 6 to 4 +move 1 from 2 to 4 +move 18 from 4 to 2 +move 3 from 1 to 4 +move 1 from 1 to 7 +move 18 from 2 to 4 +move 3 from 6 to 5 +move 15 from 4 to 1 +move 1 from 5 to 1 +move 1 from 5 to 4 +move 9 from 4 to 1 +move 5 from 1 to 3 +move 9 from 1 to 5 +move 2 from 4 to 3 +move 5 from 5 to 6 +move 3 from 7 to 9 +move 7 from 7 to 5 +move 6 from 4 to 6 +move 2 from 3 to 7 +move 6 from 5 to 8 +move 2 from 8 to 4 +move 1 from 8 to 9 +move 9 from 6 to 2 +move 3 from 9 to 3 +move 1 from 2 to 1 +move 6 from 7 to 4 +move 2 from 2 to 8 +move 3 from 9 to 5 +move 5 from 4 to 8 +move 1 from 6 to 9 +move 1 from 3 to 1 +move 1 from 3 to 4 +move 1 from 6 to 5 +move 1 from 9 to 3 +move 10 from 8 to 7 +move 3 from 9 to 2 +move 7 from 2 to 4 +move 6 from 5 to 7 +move 4 from 5 to 8 +move 7 from 3 to 2 +move 3 from 7 to 1 +move 9 from 1 to 5 +move 5 from 7 to 9 +move 7 from 1 to 4 +move 11 from 4 to 2 +move 4 from 8 to 3 +move 5 from 4 to 7 +move 4 from 4 to 1 +move 1 from 3 to 6 +move 12 from 7 to 4 +move 2 from 1 to 8 +move 5 from 9 to 7 +move 7 from 5 to 6 +move 1 from 1 to 4 +move 1 from 9 to 8 +move 1 from 4 to 7 +move 1 from 8 to 9 +move 5 from 7 to 9 +move 2 from 7 to 5 +move 2 from 6 to 3 +move 5 from 2 to 7 +move 1 from 7 to 8 +move 1 from 1 to 6 +move 3 from 5 to 1 diff --git a/resources/2022/05/test.txt b/resources/2022/05/test.txt new file mode 100644 index 0000000..42ef47f --- /dev/null +++ b/resources/2022/05/test.txt @@ -0,0 +1,9 @@ + [D] +[N] [C] +[Z] [M] [P] + 1 2 3 + +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/src/aot/core.clj b/src/aot/core.clj new file mode 100644 index 0000000..3912032 --- /dev/null +++ b/src/aot/core.clj @@ -0,0 +1,6 @@ +(ns aot.core) + +(defn foo + "I don't do a whole lot." + [x] + (println x "Hello, World!")) diff --git a/src/aot/day01.clj b/src/aot/day01.clj new file mode 100644 index 0000000..7f2fa4b --- /dev/null +++ b/src/aot/day01.clj @@ -0,0 +1,42 @@ +(ns aot.day1 + (:require [clojure.string :as string] + [clojure.java.io :as io])) + +(def test-input "2022/01/test.txt") +(def real-input "2022/01/input.txt") + +(defn parse-int [s] + (when (re-matches #"\d+" s) + (read-string s))) + +(defn parse-input + [filename] + (-> (slurp filename) + (string/split #"\n\n") + (->> (mapv (fn [line] + (-> line + (string/split #"\n") + (->> (mapv parse-int))))) ))) + +(defn solve-1 + [input] + (apply max (mapv #(apply + %) input))) + +(defn solve-pb-1 + [] + (let [parsed (parse-input (io/resource real-input))] + (solve-1 parsed))) + +(defn solve-2 + [input] + (->> input + (mapv #(apply + %)) + (sort) + (reverse) + (take 3) + (apply +))) + +(defn solve-pb-2 + [] + (let [parsed (parse-input (io/resource real-input))] + (solve-2 parsed))) diff --git a/src/aot/day02.clj b/src/aot/day02.clj new file mode 100644 index 0000000..5157eb4 --- /dev/null +++ b/src/aot/day02.clj @@ -0,0 +1,78 @@ +(ns aot.day02 + (:require [clojure.string :as string] + [clojure.java.io :as io])) + +(def test-input "2022/02/test.txt") +(def real-input "2022/02/input.txt") + +(defn parse-int [s] + (when (re-matches #"\d+" s) + (read-string s))) + +(defn words-by-line + ([filename] + (words-by-line filename (fn [_ _ v] v))) + ([filename f] + (-> (slurp filename) + (string/split #"\n") + (->> (map-indexed + (fn [line ss] + (-> ss + (string/split #" ") + (->> (map-indexed (fn [column s] + (f line column s)))) + vec)))) + vec))) + +(defn pj3 [f] + (fn [_ _ s] (f s))) + +(defn parse-input + [filename] + (words-by-line filename (pj3 keyword))) + +(defn solve-1 + [input] + (let [scores (for [[oppoent-play my-play] input] + (case oppoent-play + :A #_rock (case my-play + :X #_rock (+ 1 3) + :Y #_paper (+ 2 6) + :Z #_scissor (+ 3 0)) + :B #_paper (case my-play + :X #_rock (+ 1 0) + :Y #_paper (+ 2 3) + :Z #_scissor (+ 3 6)) + :C #_scissor (case my-play + :X #_rock (+ 1 6) + :Y #_paper (+ 2 0) + :Z #_scissor (+ 3 3))))] + (apply + scores))) + +(defn solve-pb-1 + [pb] + (let [parsed (parse-input (io/resource (if (= :real pb) real-input test-input)))] + (solve-1 parsed))) + +(defn solve-2 + [input] + (let [scores (for [[oppoent-play my-play] input] + (case oppoent-play + :A #_rock (case my-play + :X #_lose (+ 3 0) + :Y #_draw (+ 1 3) + :Z #_win (+ 2 6)) + :B #_paper (case my-play + :X #_lose (+ 1 0) + :Y #_draw (+ 2 3) + :Z #_win (+ 3 6)) + :C #_scissor (case my-play + :X #_lose (+ 2 0) + :Y #_draw (+ 3 3) + :Z #_win (+ 1 6))))] + (apply + scores))) + +(defn solve-pb-2 + [pb] + (let [parsed (parse-input (io/resource (if (= :real pb) real-input test-input)))] + (solve-2 parsed))) diff --git a/src/aot/day03.clj b/src/aot/day03.clj new file mode 100644 index 0000000..0e19a11 --- /dev/null +++ b/src/aot/day03.clj @@ -0,0 +1,71 @@ +(ns aot.day03 + (:require [clojure.string :as string] + [clojure.java.io :as io] + [clojure.set :as set])) + +(def test-input "2022/03/test.txt") +(def real-input "2022/03/input.txt") + +(defn parse-input + [filename] + (let [lines (-> (slurp filename) + (string/split #"\n") + vec) + sacks (mapv + (fn [line] + (->> line + vec + (partition (/ (count line) 2)) + (mapv set) + vec)) + lines)] + sacks)) + +(defn parse-real + [] + (parse-input (io/resource real-input))) + +(defn parse-test + [] + (parse-input (io/resource test-input))) + +(defn score-of [c] + (if (<= (int \a) (int c) (int \z)) + (inc (- (int c) (int \a))) + (+ 27 (- (int c) (int \A))))) + +(defn solve-1 + [input] + (let [sacks-prio (for [[left right] input] + (-> (set/intersection left right) + first + score-of))] + (apply + sacks-prio))) + +(defn solve-pb-1 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-1 parsed))) + +(defn solve-2 + [input] + (let [groups (->> input + (partition 3)) + scores + (for [[[l1 r1] + [l2 r2] + [l3 r3]] groups] + (score-of + (first (set/intersection (set/union l1 r1) + (set/union l2 r2) + (set/union l3 r3)))))] + (apply + scores))) + +(defn solve-pb-2 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-2 parsed))) diff --git a/src/aot/day04.clj b/src/aot/day04.clj new file mode 100644 index 0000000..4d151b4 --- /dev/null +++ b/src/aot/day04.clj @@ -0,0 +1,72 @@ +(ns aot.day04 + (:require [clojure.string :as string] + [clojure.java.io :as io] + [clojure.set :as set])) + +(def test-input "2022/04/test.txt") +(def real-input "2022/04/input.txt") + +(defn parse-int [s] + (when (re-matches #"\d+" s) + (read-string s))) + +(defn parse-line + [line] + (->> line + (re-matches #"(\d+)-(\d+),(\d+)-(\d+)") + (drop 1) + (mapv parse-int) + (partition 2))) + +(defn parse-input + [filename] + (let [lines (-> (slurp filename) + (string/split #"\n") + vec) + sections (mapv parse-line lines)] + sections)) + +(defn parse-real + [] + (parse-input (io/resource real-input))) + +(defn parse-test + [] + (parse-input (io/resource test-input))) + +(defn score-of [c] + (if (<= (int \a) (int c) (int \z)) + (inc (- (int c) (int \a))) + (+ 27 (- (int c) (int \A))))) + +(defn contained? [[[x1 y1] [x2 y2]]] + (or + (and (<= x1 x2) (>= y1 y2)) + (and (<= x2 x1) (>= y2 y1)))) + +(defn solve-1 + [input] + (count (filter contained? input))) + +(defn solve-pb-1 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-1 parsed))) + +(defn overlap? [[[x1 y1] [x2 y2]]] + (if (<= x1 x2) + (>= y1 x2) + (<= x1 y2))) + +(defn solve-2 + [input] + (count (filter overlap? input))) + +(defn solve-pb-2 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-2 parsed))) diff --git a/src/aot/day05.clj b/src/aot/day05.clj new file mode 100644 index 0000000..c2e890a --- /dev/null +++ b/src/aot/day05.clj @@ -0,0 +1,119 @@ +(ns aot.day05 + (:require [clojure.string :as string] + [clojure.java.io :as io] + [clojure.set :as set])) + +(def test-input "2022/05/test.txt") +(def real-input "2022/05/input.txt") + +(defn parse-int [s] + (when (re-matches #"\d+" s) + (read-string s))) + +(defn parse-line + [line] + (->> line + (re-matches #"(\d+)-(\d+),(\d+)-(\d+)") + (drop 1) + (mapv parse-int) + (partition 2))) + +(defn parse-crates + [crates-part] + (let [crates (->> (string/split crates-part #"\n") + (drop-last) + vec + (mapv vec) + (mapv #(partition 4 4 [] %)) + (mapv #(mapv + (fn [txt] + (let [c (second txt)] + (when (not= c \space) + (keyword (str c))))) + %))) + stacks (into {} + (for [i (range (count (last crates)))] + [(inc i) (vec (keep #(when (> (count %) i) (nth % i)) crates))]))] + stacks)) + +(defn parse-moves [moves-part] + (->> (string/split moves-part #"\n") + (mapv #(string/split % #" ")) + (mapv (fn [words] {:from (parse-int (nth words 3)) + :to (parse-int (nth words 5)) + :nb (parse-int (nth words 1))})))) + +(defn parse-input + [filename] + (let [[crates-part moves-part] + (-> (slurp filename) + (string/split #"\n\n") + vec) + crates (parse-crates crates-part) + moves (parse-moves moves-part) + ] + {:crates crates + :moves moves})) + +(defn parse-real + [] + (parse-input (io/resource real-input))) + +(defn parse-test + [] + (parse-input (io/resource test-input))) + +(defn perform-one-move [crates + {:keys [from to nb]}] + (let [poped (take nb (get crates from))] + (-> crates + (update from #(vec (drop nb %))) + (update to #(vec (concat (reverse poped) %)))))) + +(defn perform-moves [input] + (reduce perform-one-move (:crates input) (:moves input))) + +(defn solve-1 + [input] + (let [end-result (perform-moves input) + ordered-stacks (for [i (range (count (keys end-result)))] + (get end-result (inc i))) + ] + end-result + (apply str + (mapv (comp first name first) ordered-stacks)))) + +(defn solve-pb-1 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-1 parsed))) + + +(defn perform-one-move-2 [crates + {:keys [from to nb]}] + (let [poped (take nb (get crates from))] + (-> crates + (update from #(vec (drop nb %))) + (update to #(vec (concat poped %)))))) + +(defn perform-moves-2 [input] + (reduce perform-one-move-2 (:crates input) (:moves input))) + +(defn solve-2 + [input] + (let [end-result (perform-moves-2 input) + ordered-stacks (for [i (range (count (keys end-result)))] + (get end-result (inc i))) + ] + end-result + (apply str + (mapv (comp first name first) ordered-stacks)))) + +(defn solve-pb-2 + [& pb] + (let [parsed (if (= :real (first pb)) + (parse-real) + (parse-test))] + (solve-2 parsed))) diff --git a/test/aot/core_test.clj b/test/aot/core_test.clj new file mode 100644 index 0000000..937c9e7 --- /dev/null +++ b/test/aot/core_test.clj @@ -0,0 +1,7 @@ +(ns aot.core-test + (:require [clojure.test :refer :all] + [aot.core :refer :all])) + +(deftest a-test + (testing "FIXME, I fail." + (is (= 0 1))))