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

Problems being solved backwards order #137

Closed
tslater2006 opened this issue Dec 2, 2022 · 4 comments
Closed

Problems being solved backwards order #137

tslater2006 opened this issue Dec 2, 2022 · 4 comments
Labels
question Further information is requested

Comments

@tslater2006
Copy link

I added a Day02.cs today, and tried SolveLast() but it ran Day01 again. Running Solver.SolveAll() results in this output:

image

As far as I can tell the SolveAll() relies on LoadAllProblems() which just scans the assembly for classes that extend BaseDay but doesn't sort them? Unsure how to resolve this on my side, hoping you have some ideas (or I'm doing something wrong).

Project layout:
image

@tslater2006
Copy link
Author

I've also tried the naming convention Day_xx with an underscore between the class prefix and index number.

@eduherminio
Copy link
Owner

It's happening because the lack of namespace in Day02.cs file.
I'll have a look to see if I can fix the default behavior when something like this happens, but adding a namespace there should solve the issue for now.

@tslater2006
Copy link
Author

Perfect! thanks for such a quick response. Will close this issue.

@eduherminio eduherminio added the question Further information is requested label Dec 2, 2022
@eduherminio
Copy link
Owner

While implementing a solution for this use case I've concluded that "it's not a bug, it's a feature" (for now at least) 😂

When ordering types by full name instead of name, namespace is taken into account, which in some scenario can be used to run problems from different years sequentially instead of all Day01s first, all Day02s later, etc.

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

No branches or pull requests

2 participants