Skip to content

Commit 2f6cd20

Browse files
committed
docs(README): add example usage of new debuginput functionality
1 parent 7428cd4 commit 2f6cd20

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Template project for solving Advent of Code in C#, running on [.NET 5.0](https:/
1010
- [Notes](#notes)
1111
- [Generating Previous Year's Solution Files](#generating-previous-years-solution-files)
1212
- [Using a Solution's Constructor](#using-a-solutions-constructor)
13+
- [Using DebugInput](#using-debuginput)
1314
- [Using .NET Core](#using-net-core)
1415
- [Automatic Debugger Break On Exception](#automatic-debugger-break-on-exception)
1516
- [Background](#background)
@@ -19,6 +20,8 @@ Template project for solving Advent of Code in C#, running on [.NET 5.0](https:/
1920
## Features
2021
* Simple configuration with `config.json`.
2122
* Fetches puzzle input from adventofcode.com and stores it locally.
23+
* Supports easily switching between debug-input and real input.
24+
* Naive benchmarking, showing as millisecond count.
2225
* Includes various useful utilities for typical puzzle problems.
2326

2427
## Getting started
@@ -99,9 +102,20 @@ protected override string SolvePartTwo()
99102
}
100103
```
101104
* The variable `Input` will contain your input as a long raw string.
102-
* If stuck you can set the `DebugInput` variable at the top of the constructor, and it will overwrite `Input` variable, so you won't need to change all your references.
103105
* The extension method `SplitByNewLine()` will do exactly that, example: `string[] lines = Input.SplitByNewLine()` will split your input into lines for enumeration.
104106

107+
### Using DebugInput
108+
* Real inputs are stored in a file named `input`; for debug inputs, simply store them at same level in a file `debug`.
109+
* Both input files are loaded at runtime, but you must toggle the DebugInput on to use it, as shown below.
110+
```diff
111+
- public Day07() : base(07, 2015, "")
112+
+ public Day07() : base(07, 2015, "", true)
113+
{
114+
115+
}
116+
```
117+
* Setting `Debug = true` within the constructor body also works fine.
118+
105119
### Using .NET Core
106120
Simply swap out the target framework in `AdventOfCode.csproj`.
107121
```diff

0 commit comments

Comments
 (0)