part1.js 362 B

123456789101112131415161718192021
  1. const fs = require('fs')
  2. let data = fs.readFileSync('./Day 3/data.txt', 'utf8');
  3. var start = 0
  4. var right = 3
  5. var down = 1
  6. var tree = '#'
  7. let lines = data.split('\n')
  8. let linelength = lines[0].length - 1
  9. let totalLines = lines.length
  10. let dataArray = data.match(/.{1,31}/g)
  11. let stringSplit = data.split('')
  12. let map = lines.map(stringSplit)
  13. console.log(map)