Тёмный
No video :(

How hard is all 50 stars? 

chris biscardi
Подписаться 30 тыс.
Просмотров 3,6 тыс.
50% 1

Advent of Code 2023 recap.
Chapters
00:00 What is Advent of Code?
00:25 The Setup I used and how it worked out
02:28 The Leptos/Wasm site
03:04 The Justfile
04:21 Next year's changes
06:03 The Day 1 AoC experience
08:54 Solving the rest of the problems
10:45 tracing
11:00 bool::then_some
11:38 miette
12:33 set_from
12:54 rstest
13:24 std::iter::*
14:18 point in polygon
14:51 dynamic programming
15:23 2048
15:33 pathfinding
17:22 Bevy visualizations!
17:55 day 25
19:00 Useful crates
19:06 nom
19:44 Itertools
21:00 petgraph/pathfinding
21:45 glam
22:44 num
22:57 tracing
23:30 rayon
23:59 pretty_assertions
24:11 What did I learn
24:30 point in polygon
24:40 shoelace and pick's
24:55 Advent Specifics
25:27 stoer-wagner minimum cut
25:38 How hard is it to complete Advent of Code?

Опубликовано:

 

14 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@holly_hacker
@holly_hacker 7 месяцев назад
About parsing libraries: I've parsed every single day using simple `string.lines()`, `split`/`split_once` code and hardcoded indexing. The inputs are all extremely structured which makes this a very simple method, and for nearly every day I was able to parse the input in less than 10 lines of code (often in just a few). Pulling in a parsing library seems very overkill to me.
@katech6020
@katech6020 7 месяцев назад
I did the same thing as well, the inputs are fairly simple to parse directly
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
that's totally valid and I'll never tell you not to do that if that's how you want to do it. AoC, as you said, always produces valid input so an error in parsing is always an error in the player's program. Using a parsing library for a parsing task is not something I consider overkill though.
@ragectl
@ragectl 7 месяцев назад
thanks for doing this recap. It's good to hear what you enjoyed about going through it, and what recommendations you have afterwards 👍
@xixiaofin
@xixiaofin 7 месяцев назад
Thank you Chris! I'm half a year into Rust and year 2023 was also my first time doing AoC. I reached day18 or so and started to see the puzzles moved from a vehicle for me to learn Rust towards 2D 3D algorithm design, thus I stopped. If I had your suggestion (do part1 only when learning a new lang) ahead of time, I would have had the stamina to the end line. I'm surprised that you have such a sophisticated script surrounding AoC. But I understand all those aspects matter if we really wanna learn Rust well (such as benchmarking). Looking forward to learning more from your past AoC and future Rust videos! These ones add great values to newbies like me!
@wtcxdm
@wtcxdm 7 месяцев назад
Thanks for the awesome video! I am learning rust using the book and trying to get familiar by practicing advent of code. But I get stuck from time to time (for example, day 10 part 2 atm) As the quiz spends too much time for me, I think I will go back to the book… to keep my leaning journey going
@ramkumarkb
@ramkumarkb 7 месяцев назад
It was terrific learning experience following you thru the entire journey of 25 days. I cannot thank you enuf for the work and sharing the immense knowledge with the community. 🙏
@anon_y_mousse
@anon_y_mousse 7 месяцев назад
I'd like to know why they don't want the input files included in repositories since AFAIK they're unique to each user but all equally correct as tests of the code. As for reading the input, I downloaded it from the site directly and had in01.txt for the sample and in02.txt for the regular input. Although, I still used command line parameters to specify which input file to use just in case there were more than two sets of input to be tested against. I don't agree that the problems weren't well specified, but then I did use C to do them.
@Saturate0806
@Saturate0806 7 месяцев назад
well done
@hukasu
@hukasu 7 месяцев назад
the challenge that i impose on myself when doing AoC is std only, no dependencies done 2022 and 2023 in Rust with that challenge
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
That's a pretty good challenge, especially if you're familiar with Advent type problems and Rust already.
@pineberryfox
@pineberryfox 7 месяцев назад
i don't think day 1 part 2 is underspecified at all! i think a lot of the complaints regarding come from people saying "replace string by digit", but there is no mention of replacement in the problem statement. it only asks: what's the first (leftmost) valid "digit" (spelled-out or otherwise) and what's the last (rightmost) valid "digit". in "treb7uchet", it's 7 and 7, so overlap is shown off in the example input and has to be accounted for in part 1!
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
> it looks like some of the digits are actually spelled out with letters > aoc day 1, part 2 A valid interpretation of this is that digits are being replaced by words, especially since part 1 included no overlapping. 7 and 7 is not an overlap, it is the same number, and the problem description does not say "search from the left and the right and find the first number you can from either direction". The overlap in the second test case is inconsequential and can be completely ignored/missed because it is inconsequential and has no effect on the answer. The player is left to wonder if the overlap should read one way or another *because* it was underspecified and inconsequential in the test input. > the first digit and the last digit The "last digit" changes based on how you interpret the input, which is not well-specified in the test input or the problem description.
@pineberryfox
@pineberryfox 7 месяцев назад
@@chrisbiscardi I doubt that we will agree on this. But consider twoneight: left-to-right string replacement would have first- and last-digit be 2,8. Right-to-left replacement would give the same answer. But ascending-numerical-order replacement would give 1,1. i.e. string-replacement is not a well-defined method without further information. String-search without-replacement is well-defined: it gives the correct 2,8 here, and 7,9 for sevenine, regardless of the direction you process or the order you search. I would never have imagined the "replacement"-based reading at all, but given the choice between an interpretation that gives a well-defined solution and an interpretation that cannot be meaningful, I'll take the well-defined one any day.
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
@@pineberryfox yeah, you're so close here though. "given the choice of interpretations" is what you're saying here, but there shouldn't have been a choice. The puzzle should tell you the rules of the game and it didn't. You chose correctly, which is great, but there is nothing about the puzzle which indicates the correct interpretation until you run the solution on the real input. The puzzle could have said "the string numbers read the same right-to-left and left-to-right", but it didn't. The puzzle could've given an example of "twoneight" being 218, but it didn't. That's a choice in interpretation that you made based on incomplete information. 70,000+ people hit this issue and dropped off permanently. There is something wrong *with the puzzle* when almost a third of players are dropping off on day 1.
@pineberryfox
@pineberryfox 7 месяцев назад
@@chrisbiscardi The puzzle could not have given an example of twoneight being 218, because it isn't, it's 28. Explaining that it contains instances of "two", "one", and "eight" where "two" is first and "eight" is last might be fine, but then you're giving people a lot of extra, unnecessary information. I'll concede that the phrase might be ambiguous. But then, if you have two ways to interpret something, and one way leads to more unaddressed ambiguity while the other clears it up immediately, the unambiguous way is the way. Don't get me wrong, i'm not saying the puzzle would be made worse by including an example like "eightwo", i just feel like the couple people i've seen rag on its lack are being overly critical. Maybe Eric disagrees with me, agrees with you, that's fine too. On people leaving: i'd expect the curve to be roughly Zipfian, so I'm not sure how much the puzzle whose solution is to scan a string one-position-at-a-time is contributing to people leaving. If it scared people off: that sucks.
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
@@pineberryfox yeah, my critique is not meant to be "puzzle bad" but rather "55k *more* people dropped off this year on day 1 than last year, even though the total participation was pretty constant at 300k-ish, and I think this is why"
@Thefrollickingnerd
@Thefrollickingnerd 7 месяцев назад
How come the programs run faster on windows compared to mac?
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
any number of reasons really. Probably mostly that the windows pc has a newer cpu. (m1 vs ryzen 7950x)
@cat_or_not
@cat_or_not 7 месяцев назад
I just fetched the inputs at runtime from advent of code to avoid syncing input files across different computers.
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
The site makes a note about making sure you're not making too many requests to the servers, but doesn't define how many is too many, so I generally avoid putting any more load on their system than I have to.
@TRex266
@TRex266 7 месяцев назад
Should be easy to implement some sort of caching though, right?
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
honestly, committing it to the git repo is already the best form of caching to use in this scenario. Anything else is a workaround.
@adrianjdelgado
@adrianjdelgado 7 месяцев назад
bool::then_some gets flagged by clippy as an antipattern. Doing a filter followed by a map looks cleaner.
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
absolutely impossible to say why you got a clippy warning without seeing any code or even the warning id that you got. It does not get flagged the way I show in the video.
@adrianjdelgado
@adrianjdelgado 7 месяцев назад
@@chrisbiscardi My bad. The lint is called filter_map_bool_then and only applies to bool::then. The clippy lints page cites not working on then_some as a limitation.
@chrisbiscardi
@chrisbiscardi 7 месяцев назад
@@adrianjdelgado thanks for mentioning the name of the lint. I went through and made a bunch of changes to see what this would look like. While it is ok in some cases, in others it results in bending over backwards to satisfy the lint. Its also notable that the original issue that caused this lint to be created wasn't motivated by the use of then_some, it was motivated by the use of a dozen-line complex computation inside of a then(). None of my usages of then_some satisfy that condition (they are all simple "use this value"s), which the lint as-implemented also doesn't check for. In the end I decided not to apply the changes. Clippy style lints are particularly opinion-based, which is why they're in clippy and under the "style" group in the first place, so while I might follow it in the future, I don't think the change is worth it right now. github.com/ChristopherBiscardi/advent-of-code/pull/20/files
@adrianjdelgado
@adrianjdelgado 7 месяцев назад
@@chrisbiscardi Fair enough :)
Далее
The Best Games from Bevy Jam 5
9:54
Просмотров 2,4 тыс.
Coding Adventure: Sound (and the Fourier Transform)
43:31
Does this sound illusion fool you?
24:55
Просмотров 425 тыс.
going fast is about doing less
19:41
Просмотров 171 тыс.
I made Deadpool and Wolverine with just MATH and CODE!
9:05
Destroying everyone else in Advent of Code 2021 Day 22
19:08
These Problems Made Me A Great Dev
8:12
Просмотров 60 тыс.
AMD slayed the dragon - AMD Ryzen 9 9900X & 9950X
8:39
Ok, but can you do this in C?
3:15:56
Просмотров 57 тыс.
The Quickstart Template for Bevy Game Jam #5
28:29
Просмотров 2,4 тыс.
Starting a new 2d platformer with ECS
6:04
Просмотров 48 тыс.
Leptos Server Functions
9:02
Просмотров 9 тыс.