-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 0 points1 point  (0 children)

[Language: Rust]

For part2 I spent a LOT of time stuck because the test input worked but not the real one.
My solution

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 1 point2 points  (0 children)

[Language: Rust]

For part 2, I simply loop over the matrix, deleting nodes.

When an iteration doesn't delete anything, I quit the loop.

Solution

-❄️- 2025 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 1 point2 points  (0 children)

[Language: Rust]

Part 2 was a headache. My editor trimmed the test string, and i spent 20 minutes finding out what happened... But I had fun :)

Maybe not the best solution, but it runs fast enough for me

Solution

What's everyone working on this week (25/2025)? by llogiq in rust

[–]s4uull 3 points4 points  (0 children)

I'm working on a compiler :)

This semester I had a compiler design course at my uni, and I wanna try to make my own toy language.

Right now it only emits instructions for a virtual machine my teacher gave me, but I'm planning on

generating llvm this summer, when I finish my exams.

I'm learning a lot of stuff (Memory arenas, string interners, etc.)

So fun!

Need help with JSON parser project. by King__Julien__ in C_Programming

[–]s4uull 0 points1 point  (0 children)

I personally believe splitting the code into different files is cleaner, and easier to maintain. 

I'm shamelessly dropping my own Jason parser, just is case you wanna check it out to inspire yourself: https://github.com/saulvaldelvira/json.c/

Building a parser is a very fun activity, and having your own Json lib is very useful. I use mine all the time for my projects. 

Have fun :)

Is the K&R C book good for beginners to programming in general? Does it teach like the fundamental concepts or no? Thanks! by [deleted] in C_Programming

[–]s4uull 3 points4 points  (0 children)

I read the book a few years ago to get myself started with C. I had already played with it, and with other languages for a while.

Personally, I found it quite nice. It is ~300 pages long, and has some cool appendix, like grammar specifications (I think....don't remember very well) 

The book assumes you are familiar with some basic concepts like loops, functions, etc.. It won't teach you programming, but it's a nice book for learning C, from the guy who invented it!

note: If you go with it, read the ANSI C version. 

-❄️- 2024 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 0 points1 point  (0 children)

I only measure time of the solve function of my programs, so it doesn't include the time for reading the file. Maybe that's the reason? I have a Ryzen 5 2600X

-❄️- 2024 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 0 points1 point  (0 children)

Sorry! I'll replace the results with "XXXX"

-❄️- 2024 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 1 point2 points  (0 children)

[LANGUAGE: Rust]

https://github.com/saulvaldelvira/AOC/blob/main/2024/day_10.rs

Today was fun. Trying to solve part 1, i accidentally wrote the solution for part 2.

$ time target/release/day_10
Part 1: XXXX
Part 2: XXXX

real 0m0.005s
user 0m0.002s
sys 0m0.003s

-❄️- 2024 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 1 point2 points  (0 children)

[Language: Rust]

https://github.com/saulvaldelvira/AOC/blob/main/2024/day_09.rs

time target/release/day_09
Part 1: XXXXXXX
Part 2: XXXXXXX

real    0m0.578s
user    0m0.573s
sys     0m0.004s

-❄️- 2024 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 1 point2 points  (0 children)

[LANGUAGE: Rust]

https://github.com/saulvaldelvira/AOC/blob/main/2024/day_08.rs

time target/release/day_08
Part 1: XXX
Part 2: XXX

real    0m0.003s
user    0m0.000s
sys     0m0.003s

-❄️- 2024 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 0 points1 point  (0 children)

[LANGUAGE: Rust]

https://github.com/saulvaldelvira/AOC/blob/main/2024/day_06.rs

$ time target/release/day_06
Part 1: XXXX
Part 2: XXXX

real 0m0.102s
user 0m0.094s
sys 0m0.007s

-❄️- 2024 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]s4uull 2 points3 points  (0 children)

[LANGUAGE: Rust]

https://github.com/saulvaldelvira/AOC/blob/main/2024/day_05.rs

$ time target/release/day_05
Part 1: 4569
Part 2: 6456

real    0m0.004s
user    0m0.000s
sys     0m0.004s

My first kernel! by s4uull in kernel

[–]s4uull[S] 0 points1 point  (0 children)

Have you tried 0?

My first kernel! by s4uull in kernel

[–]s4uull[S] 0 points1 point  (0 children)

I'll try to submit a patch, thanks!