Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Feat: add ability to use example files #12

Merged
merged 12 commits into from
Jul 22, 2024
Merged

Conversation

bucsi
Copy link
Contributor

@bucsi bucsi commented Jul 9, 2024

My puzzle workflow is usually the following:

  1. understand the task
  2. write a solution
  3. run the solution with the example input in the task
  4. debug the solution
  5. run the solution for my puzzle input
  6. write solution for the 2nd part
  7. repeat 3-5.

With gladvent, steps 5 and 7 always involve deleting my puzzle input from the input file, then copying it back.

With this PR:

  • the new command creates a {day}.example.txt file as well
  • I introduced a new bool flag for the run command, --use-example. If it is present, the runner will pass the example txt as input

If I missed anything, please reach out and I'll gladly update my PR.

@TanklesXL TanklesXL self-requested a review July 10, 2024 19:01
@TanklesXL
Copy link
Owner

Thanks for the contribution! I haven't looked at the code yet but upon reading the description I wonder if it's worth putting the example generation behind a flag.

I would probably replace the --use-example group flag from the run group with a group flag of --example at the root so it can be used for both generation via new and running via run and run all.

Copy link
Owner

@TanklesXL TanklesXL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! I finally got a chance to dig into these changes and'm liking where things are headed. I left a few comments, the emojis I use are explained in this guide but aren't strictly necessary for understanding the comments. I just find them helpful as an organizational tool.

src/gladvent/internal/cmd/new.gleam Outdated Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Outdated Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Outdated Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Show resolved Hide resolved
src/gladvent/internal/input.gleam Show resolved Hide resolved
bucsi and others added 3 commits July 16, 2024 19:04
Co-authored-by: Robert Attard <robert.attard@mail.mcgill.ca>
TODO: configure flag in `gladvent.gleam`
Copy link
Owner

@TanklesXL TanklesXL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coming along nicely! left some more notes

src/gladvent.gleam Outdated Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Outdated Show resolved Hide resolved
src/gladvent/internal/cmd/run.gleam Outdated Show resolved Hide resolved
Co-authored-by: Robert Attard <robert.attard@mail.mcgill.ca>
@TanklesXL TanklesXL merged commit d9a4840 into TanklesXL:main Jul 22, 2024
5 checks passed
@TanklesXL
Copy link
Owner

Thanks a bunch! merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants