You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
8
## [Unreleased]
9
+
### Added
10
+
- Added `import` command which stores correct answers to problems submitted outside of the cli. ([#20](https://github.com/beakerandjake/advent-of-code-runner/issues/20) and [#240](https://github.com/beakerandjake/advent-of-code-runner/issues/240))
Stores the correct answer to a puzzle which was solved outside of advent-of-code-runner. This allows you to use advent-of-code-runner even if you already submitted answers with different tools. Before this command you couldn't let advent-of-code-runner know that you had solved a puzzle already. Once you've imported an answer you will probably want to update the corresponding solution file to add your existing code.
174
+
175
+
**Note**: All imported puzzles are set to a runtime of 999 seconds. After importing an answer, run the `solve` command to update the puzzles runtime to a real value.
176
+
177
+
Running without the `--no-confirm` flag is the default behavior. You will be asked to confirm when importing any puzzles which already exist in your `aocr-data.json` file.
178
+
179
+
```
180
+
npm run import <day> <level> <answer>
181
+
```
182
+
183
+
Running with the `--no-confirm` flag will skip any confirmation for overwriting existing data.
184
+
185
+
```
186
+
npm run import --no-confirm <day> <level> <answer>
187
+
```
188
+
189
+
#### Handling different answer types
190
+
191
+
Answers are stored as strings, so you usually don't need to wrap your answer with quotes. However there are certain answers which will need special care:
192
+
193
+
- An answer with whitespace: wrap in quotes ```npm run import 1 1 'an answer with spaces' ```
194
+
- An answer which is a negative number: use `--` before the args ```npm run import -- 1 1 -12345 ```
195
+
196
+
Examples:
197
+
- Import answer 'asdf' for day 10 level 1: `npm run import 10 1 asdf`
198
+
- Import answer 999100 for day 7 level 2: `npm run import 7 2 999100`
199
+
- Import answer -4000 for day 1 level 1 and skip confirmation: `npm run import --no-confirm -- 1 1 -4000`
200
+
201
+
#### Bulk importing
202
+
203
+
If you have already solved some puzzles, it would be tedious to manually run the `import` command a bunch of times. The wiki has a [guide](https://github.com/beakerandjake/advent-of-code-runner/wiki/Bulk-import-of-in-progress-advent-calendar) for bulk importing puzzle answers using basic linux command line tools.
0 commit comments