Skip to content

Commit 4cab7a0

Browse files
committed
moving to let
1 parent 486d7ff commit 4cab7a0

File tree

487 files changed

+2002
-2015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+2002
-2015
lines changed

src/2015/day01.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day01.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day01 2015", () => {
77
describe("part1", () => {

src/2015/day02.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day02.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day02 2015", () => {
77
describe("part1", () => {

src/2015/day03.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function step(x, y) {
22
return pos => ({ x: pos.x + x, y: pos.y + y });
33
}
44

5-
const steps = {
5+
let steps = {
66
"<": step(-1, 0),
77
">": step(1, 0),
88
"^": step(0, -1),
@@ -16,7 +16,7 @@ function parse(input) {
1616
export function part1(input) {
1717
return parse(input).reduce(
1818
(state, next) => {
19-
const pos = (state.pos = next(state.pos));
19+
let pos = (state.pos = next(state.pos));
2020
state.visited.add(`${pos.x}-${pos.y}`);
2121
return state;
2222
},
@@ -27,8 +27,8 @@ export function part1(input) {
2727
export function part2(input) {
2828
return parse(input).reduce(
2929
(state, next, index) => {
30-
const turn = index % 2 === 0 ? "santa" : "robot";
31-
const pos = (state.pos[turn] = next(state.pos[turn]));
30+
let turn = index % 2 === 0 ? "santa" : "robot";
31+
let pos = (state.pos[turn] = next(state.pos[turn]));
3232
state.visited.add(`${pos.x}-${pos.y}`);
3333
return state;
3434
},

src/2015/day03.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day03.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day03 2015", () => {
77
describe("part1", () => {

src/2015/day04.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day04.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day04 2015", () => {
77
describe("part1", () => {

src/2015/day05.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day05.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day05 2015", () => {
77
describe("part1", () => {

src/2015/day06.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day06.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day06 2015", () => {
77
describe("part1", () => {

src/2015/day07.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const ops = {
1+
let ops = {
22
AND: (p1, p2) => (2 ** 16 + (p1 & p2)) % 2 ** 16,
33
OR: (p1, p2) => (2 ** 16 + (p1 | p2)) % 2 ** 16,
44
NOT: (p1, p2) => (2 ** 16 + ~p2) % 2 ** 16,
@@ -24,7 +24,7 @@ function makeCircuit(input) {
2424
}))
2525
.reduce((circuit, gate) => {
2626
circuit[gate.result] = () => {
27-
const memo = gate.op(gate.p1(circuit), gate.p2(circuit));
27+
let memo = gate.op(gate.p1(circuit), gate.p2(circuit));
2828
circuit[gate.result] = () => memo;
2929
return memo;
3030
};

src/2015/day07.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day07.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day07 2015", () => {
77
describe("part1", () => {

src/2015/day08.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { part1, part2 } from "./day08.js";
22
import readInput from "../utils/read-input.js";
33

4-
const input = readInput(import.meta.url);
4+
let input = readInput(import.meta.url);
55

66
describe("day08 2015", () => {
77
describe("part1", () => {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy