I finally closed my FB and Insta accounts that I didn't use for over 3 years now.
It feels good
=> More informations about this toot | View the thread
Happy new year 45², for those who celebrate!
=> More informations about this toot | View the thread
This is the first time I finish #AdventOfCode on then 25th of december (and I made this last one also in #Uiua ) !
All my code in #fsharp and #uiua is here:
https://github.com/thinkbeforecoding/advent-of-code-2024
=> More informations about this toot | View the thread
[#]bayrou c'est pire que le père fouettard.
Tu t'apprêtes à passer un bon Noël et lui:
Non, ce sera valls, darmanin et borne.
=> More informations about this toot | View the thread
Day 22 of #adventofcode wqs not too difficult.
For part 2, I brut forced find the total price for all present sequence of 4 changes, and took the min.
On 20 CPUs, it finished in a few minutes while I took a shower.
=> More informations about this toot | View the thread
Oh, I'm in the metro and just found why my solution is too low...
The arm should Never be on a gap...
Will fix this, but this evening as I won't have time before
=> More informations about this toot | View the thread
[#]AdventOfCode was quite easy today
Build a map(dictionay) of the track x,y -> distance
Part1: for each point in track check if point 2 moves in direction is in track, and d2-d1-2>=100
Part2: for all pairs of points in track, if Manhattan distance m is <= 20 it's a potential cheat, check cheat gain d2-d1-m >= 100
=> More informations about this toot | View the thread
It was also important to notice that all operations are bitwise operations.
X mod 8 is X & 0b111
X div 2^N is X shift right by N
The rest is just xor
=> More informations about this toot | View the thread
And the second number of the opcode that takes no argument also.
=> More informations about this toot | View the thread
The only difference is ptobably the 2 constants used to xor, and maybe which registers are used for comptation
=> More informations about this toot | View the thread
Day 17 part 2 was fun.
I guess all programs were similar
Taking bits from A 3by3
This bits are xor with 2 constants to get an index and a value
Bits from a at this index are xor with value before output
Solver for part 2 is trying numbers in depth first from 0 to 7.
Each value impose further bits, so keep a mask of fixed bits.
At each step validate value that is tried with already set bits, this cuts all invalid branches early and terminates in less than 100 microseconds
=> More informations about this toot | View the thread
Todays part2 was simpler when you always get back to boxes and not individual cells.
A few functions to go from cell to box and box to cells made the job.
=> More informations about this toot | View the thread
This was quite logical, with a width of 101, x coordinates are the same every 101. And every 103 for y. So every 101 or 103 you have x or y echo of the image. But it's both correct in x and y only every 101*103
=> More informations about this toot | View the thread
For part 2, we noticed an horizontal corelation at 10+101x and a vertical one on 70+103x
Solving the equation, both met at -3020, but due to modulo, repeated every 101*103 seconds.
Done
[#]AdventOfCode
=> More informations about this toot | View the thread
Today's advent of code was super easy if you solved the equation directly.
The longuest part was parsing, but it worked the first time with FParsec
https://github.com/thinkbeforecoding/advent-of-code-2024/blob/main/day13.fsx
=> More informations about this toot | View the thread
Today was not really easy.
My strategy:
=> More informations about this toot | View the thread
This one made me instantly think of Lanternfish (2021 day 6)...
https://adventofcode.com/2021/day/6
=> More informations about this toot | View the thread
Today I accidentally solved part 2 before part 1...
=> More informations about this toot | View the thread
This is the #uiua code:
https://github.com/thinkbeforecoding/advent-of-code-2024/blob/main/day04.ua
Part2 is especialy short.
This is the #fsharp code:
https://github.com/thinkbeforecoding/advent-of-code-2024/blob/main/day04.fsx
=> More informations about this toot | View the thread
Today in #AdventOfCode in #uiua , I discovered the stencil operator:
https://www.uiua.org/docs/stencil
To apply a function on windows.. Super useful on part 2.
With pattern matching again.
It becomes more natural.
=> More informations about this toot | View the thread
=> This profile with reblog | Go to thinkb4coding@mastodon.social account This content has been proxied by September (ba2dc).Proxy Information
text/gemini