fspoettel / advent-of-code-rust

🎄Starter template for solving Advent of Code in Rust.
MIT License
713 stars 54 forks source link

Automatically fetch example inputs #26

Closed fspoettel closed 1 year ago

fspoettel commented 1 year ago

@NangiDev mentioned:

PS: I saw this Youtuber fetching the example input somehow 🤔 so that should be possible

Edit: I did quick test on one way of fetching example input. Gist It's not perfect because it highly depends on the text in puzzle description being typed in a particular way. It works for all (1-7) puzzles release so far this year (2022)

If it turns out that this is consistent, it would be neat to support this. We already download the puzzle by default now, maybe we can parse it from the markdown.

fspoettel commented 1 year ago

I checked some more examples and the assumption does not hold up for all days. some days e.g. contain multiple examples: https://adventofcode.com/2022/day/25. for most days, the primary example is the first pre tag, while for others, it's the second: https://adventofcode.com/2022/day/17.