File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed
Expand file tree Collapse file tree 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)
133133 }
134134
135135 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 "
137137 + $ "{ ResultToString ( 1 , Part1 ) } \n "
138- + $ "{ ResultToString ( 2 , Part2 ) } \n ";
138+ + $ "{ ResultToString ( 2 , Part2 ) } ";
139139
140140 string ResultToString ( int part , SolutionResult result ) =>
141141 $ " - Part{ part } => " + ( string . IsNullOrEmpty ( result . Answer )
Original file line number Diff line number Diff line change 1- using AdventOfCode . Services ;
2-
31namespace AdventOfCode . Solutions ;
42
53public static class SolutionCollector
64{
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-
115 public static IEnumerable < SolutionBase > FetchSolutions ( int year , IEnumerable < int > days )
126 {
137 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 ;
23
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 ) )
510{
611 Console . WriteLine ( solution . ToString ( ) ) ;
712}
You can’t perform that action at this time.
0 commit comments