Skip to content

Commit

Permalink
WIP part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHi committed Dec 21, 2023
1 parent ba7d864 commit d2d01bb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
26 changes: 26 additions & 0 deletions Typescript/2023/src/days/day20/Part2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as fs from "fs";

interface Conjection {
id: string;
memory: Map<string, boolean>;
destinations: string[];
origins: string[];
}

interface FlipFlop {
id: string;
state: boolean;
destinations: string[];
origins: string[];
}

function parseMap(isSample: boolean) {
const fileName = isSample ? "/src/days/day20/sample.txt" : "/src/days/day20/full.txt";
fs.readFileSync(process.cwd() + fileName, "utf8")
.split("\n")
.forEach((line) => {});
}

export function CalculateNeededPresses(isSample: boolean): number {
return 0;
}
5 changes: 3 additions & 2 deletions Typescript/2023/src/days/day20/day20.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Queue } from "data-structure-typed";
import * as fs from "fs";
import { CalculateNeededPresses } from "./Part2";

const isSample = true;

Expand Down Expand Up @@ -39,8 +40,8 @@ export function SolvePartOne(): number {
}

export function SolvePartTwo(): number {
console.log("TBD");
return 0;
const result = CalculateNeededPresses(isSample);
return result;
}

interface Signal {
Expand Down
2 changes: 1 addition & 1 deletion Typescript/2023/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { SolvePartOne as SolvePartOneD19, SolvePartTwo as SolvePartTwoD19 } from
import { SolvePartOne as SolvePartOneD20, SolvePartTwo as SolvePartTwoD20 } from "./days/day20/day20";
import { SolvePartOne as SolvePartOneD21, SolvePartTwo as SolvePartTwoD21 } from "./days/day21/day21";
//Please don't look at this file I dont care its ugly
const day: number = 21;
const day: number = 20;

if (day === 1) {
console.log("Day 01 Part 01: " + SolvePartOne());
Expand Down

0 comments on commit d2d01bb

Please sign in to comment.