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

Add automatic behaviors #1

Open
2 of 3 tasks
asasine opened this issue Dec 3, 2023 · 2 comments
Open
2 of 3 tasks

Add automatic behaviors #1

asasine opened this issue Dec 3, 2023 · 2 comments

Comments

@asasine
Copy link
Owner

asasine commented Dec 3, 2023

@asasine asasine changed the title Rewrite in .NET Rewrite in Rust May 16, 2024
@asasine asasine changed the title Rewrite in Rust Add automatic behaviors Dec 2, 2024
@asasine
Copy link
Owner Author

asasine commented Dec 2, 2024

So far, it seems that puzzles always yield numeric results, and part 2 alwals needs a slightly different way to parse the input data, so a standard form for the solution functions seems possible:

fn solution(input: &str) -> usize {
    // --snip--
}

@asasine
Copy link
Owner Author

asasine commented Dec 2, 2024

I'm thinking I'll steal from the unix philosophy here and lean into each day being its own binary. This is what I did for #3 and it means I can get some potential benefits:

  1. Each binary can be as flexible as necessary for that day's given puzzle.
  2. The runner can work with the simple assumption that the day's binary writes the solutions to separate lines on stdout, one line per part. If desired, this assumption can also lend itself to the runner submitting the result automatically.
  3. Any informational logs can be written to stderr ad nauseam.
  4. The runner can feed puzzle input via stdin, meaning puzzle input can be lazily fetched and cached by the runner the first time a puzzle is executed.

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

No branches or pull requests

1 participant