Toots for thinkb4coding@mastodon.social account

Written by Jérémie Chassaing on 2025-01-15 at 16:30

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

Written by Jérémie Chassaing on 2025-01-01 at 02:00

Happy new year 45², for those who celebrate!

=> More informations about this toot | View the thread

Written by Jérémie Chassaing on 2024-12-25 at 15:04

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

Written by Jérémie Chassaing on 2024-12-24 at 00:51

[#]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

Written by Jérémie Chassaing on 2024-12-22 at 12:06

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

Written by Jérémie Chassaing on 2024-12-21 at 12:02

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

Written by Jérémie Chassaing on 2024-12-20 at 08:19

[#]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

Written by Jérémie Chassaing on 2024-12-17 at 17:24

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

Written by Jérémie Chassaing on 2024-12-17 at 12:35

And the second number of the opcode that takes no argument also.

=> More informations about this toot | View the thread

Written by Jérémie Chassaing on 2024-12-17 at 12:32

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

Written by Jérémie Chassaing on 2024-12-17 at 12:26

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

Written by Jérémie Chassaing on 2024-12-15 at 12:33

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

Written by Jérémie Chassaing on 2024-12-14 at 13:55

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

Written by Jérémie Chassaing on 2024-12-14 at 13:47

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

Written by Jérémie Chassaing on 2024-12-13 at 07:31

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

Written by Jérémie Chassaing on 2024-12-12 at 09:38

Today was not really easy.

My strategy:

=> More informations about this toot | View the thread

Written by Jérémie Chassaing on 2024-12-11 at 08:05

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

Written by Jérémie Chassaing on 2024-12-10 at 07:13

Today I accidentally solved part 2 before part 1...

=> More informations about this toot | View the thread

Written by Jérémie Chassaing on 2024-12-04 at 15:41

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

Written by Jérémie Chassaing on 2024-12-04 at 15:40

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

Proxy Information
Original URL
gemini://mastogem.picasoft.net/profile/109245977498005706
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
550.955015 milliseconds
Gemini-to-HTML Time
6.150783 milliseconds

This content has been proxied by September (ba2dc).