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

88,165
33
Published 2023-12-03
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.

🏫 COURSES 🏫 Learn to code in C at lowlevel.academy/
📰 NEWSLETTER 📰 Sign up for our newsletter at mailchi.mp/lowlevel/the-low-down

🙌 SUPPORT THE CHANNEL 🙌 Become a Low Level Associate and support the channel at youtube.com/c/LowLevelLearning/join

🔥🔥🔥 SOCIALS 🔥🔥🔥
Low Level Merch!: lowlevel.store/
Follow me on Twitter: twitter.com/lowleveltweets
Follow me on Twitch: twitch.tv/lowlevellearning
Join me on Discord!: discord.gg/gZhRXDdBYY

All Comments (21)
  • @queueue_
    "It's gonna work but it's disgusting" -My exact thoughts while working on my own solution
  • @chefaku
    "Unnecessary parentheses around 'if' condition"
  • 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
  • @TimBielawa
    Chat please get AWK on the list next time
  • @scheimong
    Even when you write Rust, your code style is still so similar to C.
  • 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
  • @kainoa82858
    Can't wait to see the final episode ended off with Malbolge, where the solution takes until next christmas to find!
  • @mully006
    I think you need to add COBOL to the wheel.
  • @teakivy
    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
  • @simplicity5830
    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. :)
  • @vintagewander
    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
  • @jaydeep-p
    Didnt expect anyone to pronounce chars as "Chairs"
  • @ErikaKuykendall
    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.
  • @esveann
    Cool series! I feel like I hit many similar emotions while solving today's challenge. Especially "I don't like this solution there should be a better way to do this" ... damn I felt that
  • @rotellam
    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.
  • My solution was starting by defining a function where you would give it x / y coords where there is a single digit, and it would return the full part number where that coords belongs to, with that function working the rest was pretty straightforward
  • @DaveAxiom
    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.
  • @taukaem
    Wanted to see how to do it cleverly since I was unhappy with my solution. Accidently you boosted my confidence ;) But now I know how to use enumerate(). Thanks for that.