Post AcSfCMM5JCZCeT0aCu by drgeraint@glasgow.social
 (DIR) More posts by drgeraint@glasgow.social
 (DIR) Post #AcP5rpiqqb5ZmVFpxo by drgeraint@glasgow.social
       2023-12-02T15:56:08Z
       
       0 likes, 0 repeats
       
       I just completed "Trebuchet?!" - Day 1 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/1I don't think I'll have time to do many of these puzzles this year, but I'll upload any that I do to:https://github.com/drgeraint/adventofcode2023
       
 (DIR) Post #AcPArBkRyCmvZfVwJ6 by mina@berlin.social
       2023-12-02T16:52:00Z
       
       0 likes, 0 repeats
       
       @drgeraint Me, totally ignorant in Python, just learned that '+' concatenates strings, even if they're digits.
       
 (DIR) Post #AcPsWgNXHtu8TUpQau by drgeraint@glasgow.social
       2023-12-03T01:01:21Z
       
       0 likes, 0 repeats
       
       @mina  The plus sign (+) is possibly a poor choice for the concatenation operator in that context. Maybe & would have been better. Humans can infer type from the printed page, but the idea that 1+1=11 is clearly problematic. It needs to be that way with strings for consistency when strings cannot be fully converted to digits, but it is not ideal.
       
 (DIR) Post #AcPyYmqumwsErCxOWO by mina@berlin.social
       2023-12-03T02:08:56Z
       
       0 likes, 0 repeats
       
       @drgeraint As long as the rules are clear, it's not a problem.I don't know, how strict Python is with types, but if an extracted part of a string has to be explicitly casted into number, it's not a problem.
       
 (DIR) Post #AcRGBpvrAHJ856Qzdg by drgeraint@glasgow.social
       2023-12-03T17:01:13Z
       
       0 likes, 0 repeats
       
       I just completed "Cube Conundrum" - Day 2 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/2https://github.com/drgeraint/adventofcode2023/tree/main/day02
       
 (DIR) Post #AcRehWn8GLnYsrzwh6 by drgeraint@glasgow.social
       2023-12-03T21:35:52Z
       
       0 likes, 0 repeats
       
       I just completed "Gear Ratios" - Day 3 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/3https://github.com/drgeraint/adventofcode2023/tree/main/day03
       
 (DIR) Post #AcSfCMM5JCZCeT0aCu by drgeraint@glasgow.social
       2023-12-04T09:16:09Z
       
       0 likes, 0 repeats
       
       I just completed "Scratchcards" - Day 4 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/4https://github.com/drgeraint/adventofcode2023/tree/main/day04
       
 (DIR) Post #AcSfHfTvclKLQ4Czbs by helgztech@fosstodon.org
       2023-12-04T09:17:06Z
       
       0 likes, 0 repeats
       
       @drgeraint Go you!ahhhhhh I'm already so far behind lol.
       
 (DIR) Post #AcVlqPzSOZcehxmyY4 by drgeraint@glasgow.social
       2023-12-05T21:14:45Z
       
       0 likes, 0 repeats
       
       I just completed "If You Give A Seed A Fertilizer" - Day 5 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/5https://github.com/drgeraint/adventofcode2023/tree/main/day05
       
 (DIR) Post #AcWc19Q3Xcyy7FfZFA by drgeraint@glasgow.social
       2023-12-06T06:59:21Z
       
       0 likes, 0 repeats
       
       I just completed "Wait For It" - Day 6 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/6https://github.com/drgeraint/adventofcode2023/tree/main/day06
       
 (DIR) Post #AcZAHRuKM7FcqagwF6 by drgeraint@glasgow.social
       2023-12-07T12:32:40Z
       
       0 likes, 0 repeats
       
       I just completed "Camel Cards" - Day 7 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/7https://github.com/drgeraint/adventofcode2023/tree/main/day07
       
 (DIR) Post #AccCW9Od8fHFlH7lfU by drgeraint@glasgow.social
       2023-12-08T23:41:54Z
       
       0 likes, 0 repeats
       
       I just completed "Haunted Wasteland" - Day 8 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/8https://github.com/drgeraint/adventofcode2023/tree/main/day08
       
 (DIR) Post #AccCuPVisSbKgo0fWy by drgeraint@glasgow.social
       2023-12-08T23:46:17Z
       
       0 likes, 0 repeats
       
       Meh, I didn't enjoy that one as much as the others so far this year.The efficient solution depends on properties of the input data (which are not hinted in the specification) so it is not a general solution.Also, lcm.reduce in numpy seems to give different results each time the code is run; no idea why, but I had to use Octave for the final step.
       
 (DIR) Post #AccF2YNA0qtCOo119s by jeff@phpc.social
       2023-12-09T00:10:08Z
       
       0 likes, 0 repeats
       
       @drgeraint I was just happy I noticed the lcm/primes trick right away this time (from past years).I assume everyone's inputs have intervals that are multiples of primes, with prime length instructions.In your code, divide your intervals by your path length. LCM those, then multiply by path length. Avoids overflow.I had to write a quick wrapper for LCM on more than 2 ints in PHP.let $lcm = first numberforeach(subsequent number $n) $lcm = lcm($lcm, $n)
       
 (DIR) Post #AcdIE40hDdbcjAeEXA by drgeraint@glasgow.social
       2023-12-09T12:20:34Z
       
       0 likes, 0 repeats
       
       I just completed "Mirage Maintenance" - Day 9 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/9https://github.com/drgeraint/adventofcode2023/tree/main/day09
       
 (DIR) Post #AchTlvrFuZYhPxQMk4 by drgeraint@glasgow.social
       2023-12-11T12:48:47Z
       
       0 likes, 0 repeats
       
       I just completed "Pipe Maze" - Day 10 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/10https://github.com/drgeraint/adventofcode2023/tree/main/day10Not my most elegant solution to a problem.
       
 (DIR) Post #AciBRb9TaBWLOG3qXA by drgeraint@glasgow.social
       2023-12-11T20:58:07Z
       
       0 likes, 0 repeats
       
       I just completed "Cosmic Expansion" - Day 11 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/11https://github.com/drgeraint/adventofcode2023/tree/main/day11Far more straightforward than day 10. I was expecting something a lot more complicated for part 2.
       
 (DIR) Post #AciTUmQLvZkYOUcbwm by drgeraint@glasgow.social
       2023-12-12T00:20:24Z
       
       0 likes, 0 repeats
       
       I had to go back and rewrite day 10. I'd already got the answers, probably no one else will look at it now and I'm never going to use the code again, but I just couldn't leave it in that state.At least it is a bit more coherently written now. And it was a good distraction from the fact that the weather isn't really amenable to the long bike ride that I really want to go on.