-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to file-scoped namespaces (#208)
- Loading branch information
1 parent
c63770e
commit bdaf12e
Showing
30 changed files
with
892 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
public class LibraryDay11 : BaseLibraryDay | ||
{ | ||
public class LibraryDay11 : BaseLibraryDay | ||
public LibraryDay11() | ||
{ | ||
public LibraryDay11() | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution Library 1.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution Library 1.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
return new("Solution Library 1.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
return new("Solution Library 1.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
public class LibraryDay15 : BaseLibraryDay | ||
{ | ||
public class LibraryDay15 : BaseLibraryDay | ||
public LibraryDay15() | ||
{ | ||
public LibraryDay15() | ||
{ | ||
throw new SolvingException("Exception in constructor"); | ||
} | ||
throw new SolvingException("Exception in constructor"); | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution Library 5.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution Library 5.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution Library 5.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution Library 5.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
public class LibraryDay16 : BaseLibraryDay | ||
{ | ||
public class LibraryDay16 : BaseLibraryDay | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
throw new SolvingException("Exception in Library 6 part 1"); | ||
} | ||
throw new SolvingException("Exception in Library 6 part 1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(123); | ||
return new("Solution Library 6.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(123); | ||
return new("Solution Library 6.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
public class LibraryDay17 : BaseLibraryDay | ||
{ | ||
public class LibraryDay17 : BaseLibraryDay | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution Library 7.1"); | ||
} | ||
return new("Solution Library 7.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
throw new SolvingException("Exception in Library 7 part 2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
throw new SolvingException("Exception in Library 7 part 2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
public class LibraryDay_12 : BaseLibraryDay | ||
{ | ||
public class LibraryDay_12 : BaseLibraryDay | ||
public LibraryDay_12() | ||
{ | ||
public LibraryDay_12() | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(1); | ||
return new("Solution Library 2.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(1); | ||
return new("Solution Library 2.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(11); | ||
return new("Solution Library 2.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(11); | ||
return new("Solution Library 2.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
internal class Problem13 : BaseLibraryProblem | ||
{ | ||
internal class Problem13 : BaseLibraryProblem | ||
public Problem13() | ||
{ | ||
public Problem13() | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(101); | ||
return new("Solution Library 3.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(101); | ||
return new("Solution Library 3.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(501); | ||
return new("Solution Library 3.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(501); | ||
return new("Solution Library 3.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
internal class Problem14 : BaseLibraryProblem | ||
{ | ||
internal class Problem14 : BaseLibraryProblem | ||
{ | ||
protected override string InputFileExtension => ".in"; | ||
protected override string InputFileExtension => ".in"; | ||
|
||
public Problem14() | ||
public Problem14() | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(1500); | ||
return new("Solution Library 4.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(1500); | ||
return new("Solution Library 4.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(2000); | ||
return new("Solution Library 4.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(2000); | ||
return new("Solution Library 4.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
using System.Reflection; | ||
|
||
namespace AoCHelper.PoC.Library | ||
namespace AoCHelper.PoC.Library; | ||
|
||
internal class RandomProblem : BaseLibraryProblem | ||
{ | ||
internal class RandomProblem : BaseLibraryProblem | ||
{ | ||
/// <summary> | ||
/// Overriding FilePath, due to problem not following any convention (not even index one). | ||
/// </summary> | ||
public override string InputFilePath => | ||
Path.Combine( | ||
Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, | ||
"Inputs/LibraryRandomInput.random"); | ||
/// <summary> | ||
/// Overriding FilePath, due to problem not following any convention (not even index one). | ||
/// </summary> | ||
public override string InputFilePath => | ||
Path.Combine( | ||
Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, | ||
"Inputs/LibraryRandomInput.random"); | ||
|
||
public RandomProblem() | ||
public RandomProblem() | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution Library Random.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution Library Random.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(10_000); | ||
return new("Solution Library Random.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(10_000); | ||
return new("Solution Library Random.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
namespace AoCHelper.PoC | ||
namespace AoCHelper.PoC; | ||
|
||
public class Day01 : BaseDay | ||
{ | ||
public class Day01 : BaseDay | ||
public Day01() | ||
{ | ||
public Day01() | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
if (!File.Exists(InputFilePath)) | ||
{ | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
throw new SolvingException($"Path {InputFilePath} not found for {GetType().Name}"); | ||
} | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution 1.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution 1.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
return new("Solution 1.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
return new("Solution 1.2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
namespace AoCHelper.PoC | ||
namespace AoCHelper.PoC; | ||
|
||
public class Day05 : BaseProblem | ||
{ | ||
public class Day05 : BaseProblem | ||
public Day05() | ||
{ | ||
public Day05() | ||
{ | ||
throw new SolvingException("Exception in constructor"); | ||
} | ||
throw new SolvingException("Exception in constructor"); | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.1"); | ||
} | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.2"); | ||
} | ||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.2"); | ||
} | ||
} |
Oops, something went wrong.