Advent of Code 2023 | General Tips

preview_player
Показать описание


(Disclaimer: I receive commissions on paid memberships through my link, but Codecrafters is not a sponsor of this channel, does not endorse any of my content, and does not review any of my videos.)
Рекомендации по теме
Комментарии
Автор

Seems great, I changed it to use TS instead of JS just for my sanity but this a great way to get it all started

JimYoungman
Автор

It’s also may be useful to use Python’s assert keyword that lets you write more explicit assertion. And it works the same as the way with raising RuntimeError you shown.

Example: `assert f > 0` to check if is is positive at some point or in your case it would be `else: assert False`

alexanderchori
Автор

Good tips. I particularly like the utility scripts. Being able to automate these kind of repetitive actions, is invaluable for a tight feedback loop and being competitive for these time-based leaderboards.

As a supplement to your current approach, you might consider using a "file watcher" like wach or nodemon or entr. That way you can facilitate rapid feedback on the command line, seeing changes to the output of your solution without switching to a terminal and typing `jaoc` or `aoc`. Instead, a save (Ctrl+S) could achieve the same result without the context switch.

As an additional optimization you could research a way to copy the standard output to a clipboard if you want to quickly be able to paste the answer to the web browser with the problem open. You could also do this in your custom file watcher command that runs on file change.

If you want to optimize away the copying and pasting the answer solutions to submit answers, the form submissions might be automatable using a similar approach to how you implement your `aoc-load` function. The http form I see submits an HTTP Post to a structured url, passing in the text answer and the level in the HTTP body. I'm sure you could use your session cookie as well for authentication.

RoboDragonJediKnight
Автор

can you do previous years walkthroughs too?! Your video solutions are so helpful!

lilmorphius
Автор

Such a great contest for all skill levels. Love the tips!!!

felix.delrubio
Автор

wow looking at the leaderboard I see you're #1 for a good few. Thats

MrCreeperk
Автор

❤🎉 So inspiring! Thanks for the advice!

astrocoastalprocessor
Автор

Hello can I ask what is open(0).read(), is it the same as input() and if it is, why use it over input?

Efebur