diff --git a/2023/25/index.test.ts b/2023/25/index.test.ts index bdace18..e608524 100644 --- a/2023/25/index.test.ts +++ b/2023/25/index.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'bun:test'; -import { solveFirst, solveSecond } from './index.ts'; +import { solveFirst } from './index.ts'; describe('2023-25', () => { it('first', () => { @@ -18,10 +18,4 @@ rzs: qnr cmg lsr rsh frs: qnr lhk lsr`; expect(solveFirst(testInput)).toBe(54); }); - it('second', () => { - // TODO: add second input - const testInput = ``; - // TODO: add second solution - expect(solveSecond(testInput)).toBe(0); - }); }); diff --git a/2023/25/index.ts b/2023/25/index.ts index c7b3518..ed989b9 100644 --- a/2023/25/index.ts +++ b/2023/25/index.ts @@ -73,13 +73,9 @@ export function solveFirst(input: string): number { mult = result.mult; } while (edgeLength > 3); - console.log(`That took ${i} tries`); - console.log(mult); + if (process.env.NODE_ENV !== 'test') { + console.log(`That took ${i} tries`); + console.log(mult); + } return mult; } - -export function solveSecond(input: string): number { - // TODO: add code - - return 0; -} diff --git a/2023/25/run.ts b/2023/25/run.ts index 88783cd..226fb13 100644 --- a/2023/25/run.ts +++ b/2023/25/run.ts @@ -1,12 +1,8 @@ import { join } from 'path'; -import { solveFirst, solveSecond } from './index.ts'; +import { solveFirst } from './index.ts'; const input = await Bun.file(join(__dirname, 'input.txt')).text(); const firstAnswer = solveFirst(input); console.log(firstAnswer); - -const secondAnswer = solveSecond(input); - -console.log(secondAnswer); diff --git a/2024/02/index.test.ts b/2024/02/index.test.ts index 9137dfd..d835b79 100644 --- a/2024/02/index.test.ts +++ b/2024/02/index.test.ts @@ -13,5 +13,8 @@ describe('2024-02', () => { }); it('second', () => { expect(solveSecond(testInput)).toBe(4); + expect(solveSecond(testInput)).toBeGreaterThanOrEqual( + solveFirst(testInput) + ); }); });