Commit fd6c724 1 parent 44928ae commit fd6c724 Copy full SHA for fd6c724
File tree 3 files changed +10
-11
lines changed
3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -133,9 +133,9 @@ string LoadInput(bool debug = false)
133
133
}
134
134
135
135
public override string ToString ( ) =>
136
- $ "--- Day { Day } : { Title } --- { ( Debug ? "!! Debug mode active, using DebugInput !!" : "" ) } \n "
136
+ $ "\n --- Day { Day } : { Title } --- { ( Debug ? "!! Debug mode active, using DebugInput !!" : "" ) } \n "
137
137
+ $ "{ ResultToString ( 1 , Part1 ) } \n "
138
- + $ "{ ResultToString ( 2 , Part2 ) } \n ";
138
+ + $ "{ ResultToString ( 2 , Part2 ) } ";
139
139
140
140
string ResultToString ( int part , SolutionResult result ) =>
141
141
$ " - Part{ part } => " + ( string . IsNullOrEmpty ( result . Answer )
Original file line number Diff line number Diff line change 1
- using AdventOfCode . Services ;
2
-
3
1
namespace AdventOfCode . Solutions ;
4
2
5
3
public static class SolutionCollector
6
4
{
7
- public static IEnumerable < SolutionBase > FetchSolutions ( ) => FetchSolutions ( ConfigurationService . GetYear ( ) , ConfigurationService . GetDays ( ) ) ;
8
-
9
- public static IEnumerable < SolutionBase > FetchSolutions ( int year ) => FetchSolutions ( year , ConfigurationService . GetDays ( ) ) ;
10
-
11
5
public static IEnumerable < SolutionBase > FetchSolutions ( int year , IEnumerable < int > days )
12
6
{
13
7
if ( days . Sum ( ) == 0 ) days = Enumerable . Range ( 1 , 25 ) . ToArray ( ) ;
Original file line number Diff line number Diff line change 1
- using AdventOfCode . Solutions ;
1
+ using AdventOfCode . Services ;
2
+ using AdventOfCode . Solutions ;
2
3
3
- Console . WriteLine ( ) ;
4
- foreach ( var solution in SolutionCollector . FetchSolutions ( ) )
4
+ var year = ConfigurationService . GetYear ( ) ;
5
+ var days = ConfigurationService . GetDays ( ) ;
6
+
7
+ if ( args . Length > 0 && int . TryParse ( args . First ( ) , out int day ) ) days = new [ ] { day } ;
8
+
9
+ foreach ( var solution in SolutionCollector . FetchSolutions ( year , days ) )
5
10
{
6
11
Console . WriteLine ( solution . ToString ( ) ) ;
7
12
}
You can’t perform that action at this time.
0 commit comments