Rust Finally Betrayed Me (Coding in a Random Language Every Day)

preview_player
Показать описание
Advent of Code 2023 is UPON US! What better way to spend the holiday season, learn to program, and test your skills against your friends. This year, I've decided to try something kind of insane. I'll be choosing a language off the wheel every day.... let's see what happens.

🔥🔥🔥 SOCIALS 🔥🔥🔥
Рекомендации по теме
Комментарии
Автор

"It's gonna work but it's disgusting" -My exact thoughts while working on my own solution

queueue_
Автор

"Unnecessary parentheses around 'if' condition"

chefaku
Автор

Took me 2.5 hours for both the stars. 90% of time was trying to make my logic work in rust and rest 10% was me contemplating if I should just use python

siddharthbisht
Автор

Even when you write Rust, your code style is still so similar to C.

scheimong
Автор

How it started: *rust copium*
How it went: “This is disgusting” “the classic off by one error” (lol, lmao even, rust safety go brrrr)

It’s beautiful, brings a tear to my eye. Rust culture aside, solid video homie

combatcorgiofficial
Автор

Chat please get AWK on the list next time

TimBielawa
Автор

Can't wait to see the final episode ended off with Malbolge, where the solution takes until next christmas to find!

kainoa
Автор

Love this idea since day 1, i'm doing something similar where each weekday is a different (set) language, so
Monday - PHP (never touched before and am scared for tomorrow)
Tuesday - Pyhon
Wednesday - Rust (just started learning)
Thursday - C# (havent used in years)
Friday - Java
Saturday - C++ (barely used)
Sunday - Typescript

teakivy
Автор

I spent a long time on this, and the whole time thinking "I must be so stupid"... Then I watch this and find I did almost the same logic in my solutions, one with and one without Regex.

Thanks for making me not feel stupid, that a programmer magnitudes much better and more experienced than me didn't have a solution that to me is unintelligeable. :)

simplicity
Автор

I think you need to add COBOL to the wheel.

mully
Автор

As a rust dev, this season's advent of code really makes me want to just switch to C++ due to the strict nature of Rust trying to prevent you doing bad things with strings, even I know damn well the input strings are just pure ascii chars 😂. Well I can use a library for doing ascii things but currently I don't want that

vintagewander
Автор

Didnt expect anyone to pronounce chars as "Chairs"

jaydeep-p
Автор

I approached this one as an axis aligned bounding box collision detection problem - just treat every symbol as a 3x3 box centered at the symbol, find what collides with it.

ErikaKuykendall
Автор

Wrote this day in Rust as well. Surprisingly not painful. It helped that I made the smallest thing a separate function. The very first thing I did was make a function that extracted the part code from a line, from wherever you started on that line if you started on a digit.

mbyx_
Автор

So you kept saying "If Haskell gets on this list, I'm f'd"... but... like... you KNEW this would 100% guarantee they choose Haskell. Right?

largepimping
Автор

These 3 days were "How to make nasty things to parse tutorial"

francescotomba
Автор

Haskell was put on the wheel! It's a very powerful language and is the most popular of functional programming languages. It has its roots in academia but it's used in the industry often. Its strength is in symbol manipulation making it perfect for this challenge. Benchmarks on Haskell programs have shown it to be very fast too.

DaveAxiom
Автор

Really glad it wasn't just me! My algorithm was similar; I read the array left to right, top to bottom and when it found a digit started reading that into a buffer until there wasn't any more digits while keeping track of x and y for those digits, then checked if there was any symbols around it (previous line, before and after, next line). To avoid index issues in the array I added a line of dots to the beginning and end and a dot at the start and end of each line. That worked fine, but I found the second star much harder. I did the same thing but only recorded if there was a * around the number, then walked in a circle around the * to look for a second number, and assumed there was no duplicate two numbers in the array.

rotellam
Автор

I looped over chars, and each time i encountered a digit, i searched around the digit for a symbol & marked the cur_num as valid if yes.

Part2 was similar. For each *, searched around, then found the start of any number & kept an array of start-positions to prevent duplicates.

reed
Автор

I want to see a challenge completed in assembly.

bradybrandt