this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Restructure repo

modamo-gh a47019ba e700cf83

+1 -35
+1
.gitignore
··· 1 + day*/input.txt
-35
day01.ts
··· 1 - const partOne = () => { 2 - const input = "puzzleInput"; 3 - const parsedInput = input.split(/\n/); 4 - const instructions = parsedInput.map((instruction) => ({ 5 - direction: instruction[0], 6 - amount: Number(instruction.slice(1)) % 100 7 - })); 8 - 9 - let dialPosition = 50; 10 - let dialAtZero = 0; 11 - 12 - for (const instruction of instructions) { 13 - if (instruction.direction === "L") { 14 - dialPosition -= instruction.amount; 15 - 16 - if (dialPosition < 0) { 17 - dialPosition = 99 + dialPosition + 1; 18 - } 19 - } else { 20 - dialPosition += instruction.amount; 21 - 22 - if (dialPosition > 99) { 23 - dialPosition %= 100; 24 - } 25 - } 26 - 27 - if(dialPosition === 0){ 28 - dialAtZero++; 29 - } 30 - } 31 - 32 - console.log(dialAtZero) 33 - }; 34 - 35 - partOne();
day01/part1.ts

This is a binary file and will not be displayed.

day01/part2.ts

This is a binary file and will not be displayed.

day02.ts day11/part2.ts
day02/part1.ts

This is a binary file and will not be displayed.

day02/part2.ts

This is a binary file and will not be displayed.

day03.ts day07/part2.ts
day03/part1.ts

This is a binary file and will not be displayed.

day03/part2.ts

This is a binary file and will not be displayed.

day04.ts day08/part1.ts
day04/part1.ts

This is a binary file and will not be displayed.

day04/part2.ts

This is a binary file and will not be displayed.

day05.ts day08/part2.ts
day05/part1.ts

This is a binary file and will not be displayed.

day05/part2.ts

This is a binary file and will not be displayed.

day06.ts day09/part1.ts
day06/part1.ts

This is a binary file and will not be displayed.

day06/part2.ts

This is a binary file and will not be displayed.

day07.ts day09/part2.ts
day07/part1.ts

This is a binary file and will not be displayed.

day08.ts day10/part1.ts
day09.ts day10/part2.ts
day10.ts day11/part1.ts
day11.ts day12/part1.ts
day12.ts day12/part2.ts