diff --git a/day_1/task_1.js b/day_1/task_1.js index 65a6a49..4839b3f 100644 --- a/day_1/task_1.js +++ b/day_1/task_1.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); arr.forEach(num => { diff --git a/day_1/task_2.js b/day_1/task_2.js index 6904256..044afdc 100644 --- a/day_1/task_2.js +++ b/day_1/task_2.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); arr.forEach(num => { diff --git a/day_2/task_1.js b/day_2/task_1.js index 7cc5298..5675dcc 100644 --- a/day_2/task_1.js +++ b/day_2/task_1.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); let invalid = [] diff --git a/day_2/task_2.js b/day_2/task_2.js index c0bc688..df4fbf0 100644 --- a/day_2/task_2.js +++ b/day_2/task_2.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); let invalid = [] diff --git a/day_3/task_1.js b/day_3/task_1.js index 227c40d..f85c24e 100644 --- a/day_3/task_1.js +++ b/day_3/task_1.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); let trees = 0; diff --git a/day_3/task_2.js b/day_3/task_2.js index 1885395..c3e652d 100644 --- a/day_3/task_2.js +++ b/day_3/task_2.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const arr = file.split('\n'); const speeds = [ diff --git a/day_4/task_1.js b/day_4/task_1.js index 370f953..8c88db1 100644 --- a/day_4/task_1.js +++ b/day_4/task_1.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const passports = file.split('\n\n'); const fieldNames = { diff --git a/day_4/task_2.js b/day_4/task_2.js index 8f3d841..34d7081 100644 --- a/day_4/task_2.js +++ b/day_4/task_2.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const file = fs.readFileSync('./input.txt').toString('utf-8'); +const file = fs.readFileSync(__dirname + '/input.txt').toString('utf-8'); const passports = file.split('\n\n'); const fieldNames = {