Commit Graph
100 Commits
Author SHA1 Message Date
warrence 0ccb047312 Fixed test project unit order 2024-06-17 14:01:53 +02:00
warrence 3e7943056a Added new alternative data path ..\..\data 2024-06-17 14:01:23 +02:00
warrence f66e3fc2d8 Removed full data test cases
Providing full access to the solver code is the purpose of this project
repository. However, I think there should be some work in getting to
the actual solutions to not open the doors to abuse.
2024-06-17 14:00:22 +02:00
warrence 8eb76329c1 Moved common TPoint direction code into new unit 2024-06-10 20:48:07 +02:00
warrence 19509c6173 Fixed memory leak in TSnowverload 2024-06-10 20:46:54 +02:00
warrence e81df9d558 Added test categories to all registered test cases 2024-06-10 20:24:05 +02:00
warrence 3f83f888f3 Updated solution for day 25, significantly speeding up the algorithm 2024-06-05 13:40:31 +02:00
warrence c5ea70ed21 Added solution for "Day 25: Snowverload", part 1 2024-06-04 17:14:24 +02:00
warrence 216839c98b Fixed copyright date 2024-06-03 20:52:42 +02:00
warrence 3c2acf05e8 Fixed project uses 2024-06-03 20:50:56 +02:00
warrence c2570fab3d Removed unused dividers factorization 2024-06-03 14:49:21 +02:00
warrence 33e7b64276 Added puzzle commentary for day 24 2024-05-27 03:10:14 +02:00
warrence 859a5db921 Merge branch 'day24-analytical' 2024-05-27 02:53:03 +02:00
warrence b27b14a153 Fixed day 24 helper variable indices 2024-05-27 02:52:22 +02:00
warrence 3e3e1d45d3 Added solution "Day 24: Never Tell Me The Odds", part 2 2024-05-27 02:29:49 +02:00
warrence 44caf3e21c Fixed comments 2024-05-26 19:58:13 +02:00
warrence 1784e41c0f Fixed root isolation interval data types 2024-05-26 19:28:04 +02:00
warrence 5f93ad7869 Added bisection variant for integers instead of intervals 2024-05-26 18:59:47 +02:00
warrence 7db8f948c5 Changed TPolynomialRoots.BisectIsolation return type to array 2024-05-26 17:34:18 +02:00
warrence 8d4a5c2ed8 Changed root finder to use base-2 exponent of bound
Since the root isolation algorithm uses a power of two as bound anyway,
it makes sense to use it's exponent in method interfaces and throughout
the algorithm. This simplifies multiplications to cheap shifts and will
make it easier to detect when the isolating interval size is 1.

Also added some method documentation.
2024-05-26 17:31:37 +02:00
warrence 04e1702a2e Added TBigIntPolynomial.ScaleVariableByPowerOfTwo 2024-05-26 16:59:16 +02:00
warrence ab453b347d Renamed root finding class and methods, now class methods 2024-05-26 14:23:31 +02:00
warrence ae30889bbb Fixed calculation of root-isolating intervals and tests 2024-05-25 02:51:00 +02:00
warrence 748964c871 Fixed broken polynomial degree in bisection algorithm 2024-05-25 02:37:34 +02:00
warrence fa5616f3cc Fixed initializer of zero polynomial 2024-05-25 02:35:55 +02:00
warrence baa1f8f31f Added bisection root finding algorithm with custom upper bound 2024-05-24 20:47:52 +02:00
warrence 53e3922654 Updated bisection root finding algorithm and test case 2024-05-24 20:22:06 +02:00
warrence cbaffbf55e Added TBigIntPolynomial methods needed for bisection algorithm 2024-05-24 12:03:25 +02:00
warrence aef4f28f46 Changed zero polynomial resulting from scaling to have one coefficient 2024-05-23 22:11:22 +02:00
warrence 37309d2817 Moved TBigIntPolynomial.IsEqualTo within the class 2024-05-23 22:07:58 +02:00
warrence 6802da1743 Merge branch 'bigint' into day24-analytical 2024-05-23 22:03:41 +02:00
warrence 2df8266d42 Added some improvements for TBigInt shift left operator 2024-05-23 22:01:25 +02:00
warrence 4329041353 Added TBigInt shift right operator and tests 2024-05-23 22:00:45 +02:00
warrence 18f432bdfe Added parenthesis in TBigInt.ToString for negative values 2024-05-23 21:08:01 +02:00
warrence cfb74da86b Added TBigInt.One 2024-05-23 21:07:11 +02:00
warrence fad6e496c0 Removed unintentional WriteLn comments 2024-05-23 21:06:33 +02:00
warrence 9d444272e0 Merge branch 'bigint' into day24-analytical 2024-05-20 15:04:32 +02:00
warrence 52cee73123 Added TBigInt.GetMostSignificantBitIndex and tests 2024-05-20 15:03:54 +02:00
warrence afefbf46e3 Removed main project unit refs from FPCUnit project 2024-05-20 01:05:16 +02:00
warrence 7ac4a3519a Added TBigIntPolynomial.ToString 2024-05-20 01:04:18 +02:00
warrence d503968cee Merge branch 'bigint' into day24-analytical 2024-05-20 01:01:20 +02:00
warrence 2ca960f19c Added TBigInt.ToString for debugging 2024-05-20 00:59:40 +02:00
warrence 9c951073d9 Removed irrelevant todo 2024-05-20 00:56:52 +02:00
warrence 18de900a38 Fixed BigInt subtraction for equal operands 2024-05-20 00:56:22 +02:00
warrence c25317c0fc Merge branch 'bigint' into day24-analytical 2024-05-16 17:14:00 +02:00
warrence 62887ad1d7 Fixed BigInt multiplication test cases 2024-05-16 17:08:44 +02:00
warrence 7630bdddeb Fixed array init in BigInt shift and replaced Move 2024-05-16 17:08:05 +02:00
warrence df8b5c32fd Fixed BigInt test cases 2024-05-14 16:52:32 +02:00
warrence 1caee9ae6e Fixed BigInt string initializers 2024-05-14 16:52:09 +02:00
warrence eee05a9646 Added BigInt test cases (many broken) 2024-05-13 18:20:23 +02:00
warrence e11db7155a Added more BigInt features and fixes
- Fixed some uses of Move
- Added Sign, string initializers (hexadecimal and binary), explicit
converter to Int64, comparison operators
2024-05-13 18:19:15 +02:00
warrence 53827acf9b Added new unit for polynomial root finding algorithm 2024-05-13 15:22:18 +02:00
warrence 4c0ff2f23f Added TBigIntPolynomial.ScaleVariable 2024-05-13 15:22:18 +02:00
warrence 0bbae0a83e Added polynomial degree and coefficients as public properties 2024-05-13 15:22:18 +02:00
warrence 71c8462358 Added TBigInt unequal operator 2024-05-13 15:22:12 +02:00
warrence 5808ec24f2 Added polynomials 2024-05-13 15:21:58 +02:00
warrence eb2b4a3f99 Added TBigInt unequal operator 2024-05-13 15:17:13 +02:00
warrence eca6b8f3f9 Added an example for the expected input file names in the readme 2024-02-22 22:55:37 +01:00
warrence 5b0a7996c5 Changed some of the expected input file names to stay closer to the day titles 2024-02-22 22:54:45 +01:00
warrence 801f8aa643 Added support for multiple data root paths 2024-02-22 22:26:31 +01:00
warrence 44c2c845e0 Added WIP analytical solution attempt 2024-02-21 21:05:34 +01:00
warrence 824ec0e29b Added error handling for missing data files 2024-02-21 20:59:21 +01:00
warrence 3f4a64b6e0 Removed puzzle and example inputs in accordance with the Advent of Code copyright notice 2024-02-20 23:31:35 +01:00
warrence 356cc2ad5e Merge branch 'bigint' into day24-analytical 2024-02-14 13:21:15 +01:00
warrence 9f619adc01 Fixed addition: final carry-over was inserted at the wrong end of the number 2024-02-14 12:09:18 +01:00
warrence ef1eba4538 Fixed shl operator: incorrect move for full digit shifts 2024-02-14 12:09:18 +01:00
warrence cec6985489 Updated operators 2024-02-14 12:09:18 +01:00
warrence 5a3c320942 Fixed TBigInt heap memory allocation (fixed memory leaks) 2024-02-14 12:09:18 +01:00
warrence bfb33673ee Fixed some redundant parenthesis 2024-02-14 12:09:18 +01:00
warrence 7a6623c99c Added draft of TBigInt object 2024-02-14 12:09:18 +01:00
warrence a034fbaedc Added integer factorization and enumeration of dividers 2024-01-31 18:58:49 +01:00
warrence cccf5693f7 Fixed negative GCD and allow Int64 for GCD and LCM 2024-01-23 12:21:43 +01:00
warrence 571019d604 Removed fgl references 2023-12-30 23:20:52 +01:00
warrence fb3f41a6af Added solution for "Day 24: Never Tell Me The Odds", part 1 2023-12-26 19:46:35 +01:00
warrence 5495b32692 Added solution for "Day 23: A Long Walk", part 1 2023-12-25 00:44:13 +01:00
warrence c3ecaf59fa Added custom constructors for TCosmicExpansion and TStepCounter to simplify test case setup 2023-12-23 20:16:18 +01:00
warrence 2bb89c952b Added solution for "Day 22: Sand Slabs", part 2 2023-12-23 20:08:10 +01:00
warrence 7b77846abc Added solution for "Day 22: Sand Slabs", part 1 2023-12-23 01:30:41 +01:00
warrence 197e5f81b9 Removed left-over comments from TStepCounter 2023-12-22 15:15:56 +01:00
warrence 4e28a7a4c2 Removed or unregistered tests for incomplete solutions 2023-12-21 21:14:50 +01:00
warrence 9855a38e50 Fixed missing visibility modifier on TFactor10CosmicExpansion test class 2023-12-21 21:12:18 +01:00
warrence bc2568756b Added solution for "Day 21: Step Counter", part 1 2023-12-21 21:11:31 +01:00
warrence 8d5757fae0 Added p/puzzle command line option to run only specific puzzles, and updated the application help text 2023-12-21 18:32:40 +01:00
warrence 55f8f3d674 Added solution for "Day 20: Pulse Propagation", part 1 2023-12-21 16:14:00 +01:00
warrence b2bfbf1993 Added solution for "Day 19: Aplenty", part 2 2023-12-20 19:25:21 +01:00
warrence c3019613bd Added solution for "Day 19: Aplenty", part 1 2023-12-20 11:41:17 +01:00
warrence b32a7345cb Updated puzzle commentary for days 13, 14, 15, and 16 2023-12-19 19:03:46 +01:00
warrence 58da932860 Added empty skeleton implementations and tests for days 17, 18, and 19 2023-12-19 17:57:58 +01:00
warrence 01ec0be32c Added solution for "Day 16: The Floor Will Be Lava", part 2 2023-12-19 17:26:18 +01:00
warrence e9737f0265 Moved the constants in UFloorWillBeLava below the types so that they can be together in a single const block 2023-12-19 13:15:46 +01:00
warrence 58c677f409 Added solution for "Day 16: The Floor Will Be Lava", part 1 2023-12-19 13:11:39 +01:00
warrence 2902689d07 Removed day 14 debugging code 2023-12-18 21:14:35 +01:00
warrence 95de6f1f7b Added another small performance improvement for day 14 2023-12-18 21:13:50 +01:00
warrence 29663ad82e Merge branch 'day14-test' 2023-12-18 20:33:47 +01:00
warrence 515d39da40 Updated day 14 algorithm to not operate directly on the strings 2023-12-18 20:30:24 +01:00
warrence d582eb4d52 Added solution for "Day 15: Lens Library", part 2 2023-12-17 23:11:44 +01:00
warrence 3501f6f574 Added solution for "Day 15: Lens Library", part 1 2023-12-15 18:21:37 +01:00
warrence d8b298dad8 Updated day 14 solution with some small code improvements 2023-12-15 00:46:21 +01:00
warrence 22b9a24893 Added solution for "Day 14: Parabolic Reflector Dish", part 2 2023-12-14 21:23:07 +01:00
warrence 637e7aedad Added missing test value for day 14, part 1 2023-12-14 20:47:46 +01:00