comments removed
This commit is contained in:
parent
bd4374c810
commit
3c8fea51a8
1 changed files with 0 additions and 4 deletions
|
@ -14,7 +14,6 @@ class DayThree implements Solvable {
|
||||||
.map(arr => Number.parseInt(arr))
|
.map(arr => Number.parseInt(arr))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public part1(): Solvable {
|
public part1(): Solvable {
|
||||||
const re = /mul\([0-9]{1,3},[0-9]{1,3}\)/g
|
const re = /mul\([0-9]{1,3},[0-9]{1,3}\)/g
|
||||||
// get all matches and parse them to int[]
|
// get all matches and parse them to int[]
|
||||||
|
@ -33,7 +32,6 @@ class DayThree implements Solvable {
|
||||||
let active = true
|
let active = true
|
||||||
let result = 0
|
let result = 0
|
||||||
for (const inst of instructions) {
|
for (const inst of instructions) {
|
||||||
console.log((active ? '' : 'skipping ') + inst )
|
|
||||||
if (inst === 'do()') {
|
if (inst === 'do()') {
|
||||||
active = true
|
active = true
|
||||||
continue
|
continue
|
||||||
|
@ -45,8 +43,6 @@ class DayThree implements Solvable {
|
||||||
if (active) {
|
if (active) {
|
||||||
const [left, right] = this.multiplyInstruction(inst)
|
const [left, right] = this.multiplyInstruction(inst)
|
||||||
result += left * right
|
result += left * right
|
||||||
console.log((active ? 'multiplying ' : '' ), left, right)
|
|
||||||
console.log(left, right)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
|
Loading…
Reference in a new issue