You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When solving Advent of Code puzzles, a common repetitive task is manually copying example inputs from the puzzle's markdown file and saving them in the data/examples directory. This process can be tedious and error-prone.
Proposed Solution
Introduce a command that scans the puzzle text for example inputs and writes them to files in data/examples.
Detection Method:
Example inputs are always presented as code blocks (enclosed within triple backticks ```).
In case of multiple code blocks, some may contain outputs, diagrams, or other non-input content. To handle this, the command can prompt the user interactively to confirm which blocks should be saved.
Naming Convention:
If only one input is accepted, it should be saved as ${day}.txt.
If multiple inputs are extracted, they should be named ${day}-{part}.txt.
Expected Workflow
Run the command (e.g., cargo extract ${day}).
The tool scans the puzzle markdown file for code blocks.
If multiple blocks are found, the user is prompted to confirm which ones should be saved.
Selected example inputs are saved with appropriate filenames.
The text was updated successfully, but these errors were encountered:
When solving Advent of Code puzzles, a common repetitive task is manually copying example inputs from the puzzle's markdown file and saving them in the data/examples directory. This process can be tedious and error-prone.
Proposed Solution
Introduce a command that scans the puzzle text for example inputs and writes them to files in data/examples.
Detection Method:
Example inputs are always presented as code blocks (enclosed within triple backticks ```).
In case of multiple code blocks, some may contain outputs, diagrams, or other non-input content. To handle this, the command can prompt the user interactively to confirm which blocks should be saved.
Naming Convention:
If only one input is accepted, it should be saved as
${day}.txt
.If multiple inputs are extracted, they should be named
${day}-{part}.txt
.Expected Workflow
cargo extract ${day}
).The text was updated successfully, but these errors were encountered: