deleted: javascript/day1.js

new file:   javascript/day1/day1.js
renamed:    javascript/day2.js -> javascript/day2/day2.js
main
vicentpc95 2023-12-07 14:38:04 +01:00
parent 81838472dc
commit 210a6d6338
3 changed files with 19 additions and 0 deletions

View File

19
javascript/day1/day1.js Normal file
View File

@ -0,0 +1,19 @@
import * as fs from "fs"
let data = fs.readFileSync("inputday1.txt").toString()
data = data.replaceAll("one", "o1e")
data = data.replaceAll("two", "t2o")
data = data.replaceAll("three", "t3e")
data = data.replaceAll("four", "f4r")
data = data.replaceAll("five", "f5e")
data = data.replaceAll("six", "s6x")
data = data.replaceAll("seven", "s7n")
data = data.replaceAll("eight", "e8t")
data = data.replaceAll("nine", "n9e")
let sumNum = 0
let lines = data.split("\n")
for (let line of lines){
}