From a66110f9b965aa932c99d6469c8eb08f1fdfe12e Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Sun, 3 Dec 2023 13:23:13 +0100 Subject: [PATCH] ignore last empty line, a bit stupid to include in each assignment --- .gitignore | 2 ++ 2023/01/impl.js | 1 - 2023/01/input.txt | 2 +- 2023/02/impl.js | 1 - 2023/02/input.txt | 2 +- adventofcode.sublime-project | 8 ++++++++ 6 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 adventofcode.sublime-project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b4e23f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.bin +*.sublime-workspace \ No newline at end of file diff --git a/2023/01/impl.js b/2023/01/impl.js index 5d8188d..96771df 100644 --- a/2023/01/impl.js +++ b/2023/01/impl.js @@ -2,7 +2,6 @@ module.exports.solve = function(input) { return input.split('\n') - .filter(line => line.length > 1) .map(line => { const nrs = line.replace(/[^0-9.]/g, '') return parseInt(nrs[0] + nrs[nrs.length - 1]) diff --git a/2023/01/input.txt b/2023/01/input.txt index 7bbc69a..1ba8437 100644 --- a/2023/01/input.txt +++ b/2023/01/input.txt @@ -1,4 +1,4 @@ 1abc2 pqr3stu8vwx a1b2c3d4e5f -treb7uchet +treb7uchet \ No newline at end of file diff --git a/2023/02/impl.js b/2023/02/impl.js index ca0d35e..3e56181 100644 --- a/2023/02/impl.js +++ b/2023/02/impl.js @@ -29,7 +29,6 @@ module.exports.solve = function(input, bagConfig) { } return input.split('\n') - .filter(line => line.length > 1) .map(parseGame) .filter(isGamePossible) .map(game => game.id) diff --git a/2023/02/input.txt b/2023/02/input.txt index 295c36d..1cd7d33 100644 --- a/2023/02/input.txt +++ b/2023/02/input.txt @@ -2,4 +2,4 @@ Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red -Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green +Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green \ No newline at end of file diff --git a/adventofcode.sublime-project b/adventofcode.sublime-project new file mode 100644 index 0000000..24db303 --- /dev/null +++ b/adventofcode.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "." + } + ] +}