-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7687509
commit b7e381d
Showing
27 changed files
with
316 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
input.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
{ | ||
"tasks": { | ||
"decrypt": "deno run -ERW src/encrypt.ts --decrypt", | ||
"dev": "deno test --watch -R src/$DAY/test.ts", | ||
"input": "deno run -NEWR src/encrypt.ts --get=$DAY", | ||
"solve": "deno run -R src/$DAY/main.ts", | ||
"test": "deno test -R src" | ||
"test": "deno test -R src/**/test.ts", | ||
"test:input": "deno test -R src/**/input.test.ts" | ||
}, | ||
"imports": { | ||
"@std/assert": "jsr:@std/assert@^1.0.8" | ||
"@std/assert": "jsr:@std/assert@^1.0.8", | ||
"@std/cli": "jsr:@std/cli@^1.0.8", | ||
"@std/crypto": "jsr:@std/crypto@^1.0.3", | ||
"@std/dotenv": "jsr:@std/dotenv@^0.225.3", | ||
"@std/encoding": "jsr:@std/encoding@^1.0.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct placeholder for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct placeholder1 for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.text, ""); | ||
}); | ||
|
||
Deno.test(`correct placeholder2 for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.text, ""); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
const target = "input"; | ||
|
||
Deno.test(`correct distance for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.distance, 3246517); | ||
}); | ||
|
||
Deno.test(`correct similarity for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.similiarity, 29379307); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct distance for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct distance for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.distance, 11); | ||
}); | ||
|
||
Deno.test("correct similarity for sample", async () => { | ||
const result = await main("sample"); | ||
Deno.test(`correct similarity for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.similiarity, 31); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
const target = "input"; | ||
|
||
Deno.test(`correct safe count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.safeLines, 660); | ||
}); | ||
|
||
Deno.test(`correct dampended safe count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.dampenedSafeLines, 689); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct safe count for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct safe count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.safeLines, 2); | ||
}); | ||
|
||
Deno.test("correct dampended safe count for sample", async () => { | ||
const result = await main("sample"); | ||
Deno.test(`correct dampended safe count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.dampenedSafeLines, 4); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
const target = "input"; | ||
|
||
Deno.test(`correct quotient sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.quotientSum, 163931492); | ||
}); | ||
|
||
Deno.test(`correct do quotient sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.doQuotientSum, 76911921); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct quotient sum for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct quotient sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.quotientSum, 161); | ||
}); | ||
|
||
Deno.test("correct quotient sum for sample with do", async () => { | ||
Deno.test(`correct do quotient sum for sample with do`, async () => { | ||
const result = await main("sample-do"); | ||
assertEquals(result.doQuotientSum, 48); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
const target = "input"; | ||
|
||
Deno.test(`correct xmas count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.wordCount, 2718); | ||
}); | ||
|
||
Deno.test(`correct x-mas count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.xCount, 2046); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct xmas count for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct xmas count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.wordCount, 18); | ||
}); | ||
|
||
Deno.test("correct x-mas count for sample", async () => { | ||
const result = await main("sample"); | ||
Deno.test(`correct x-mas count for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.xCount, 9); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
const target = "input"; | ||
|
||
Deno.test(`correct legal update middle page sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.legalUpdateMiddlePageSum, 5955); | ||
}); | ||
|
||
Deno.test(`correct fixed update middle page sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.fixedUpdateMiddlePageSum, 4030); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { assertEquals } from "@std/assert"; | ||
import { main } from "./main.ts"; | ||
|
||
Deno.test("correct legal update middle page sum for sample", async () => { | ||
const result = await main("sample"); | ||
const target = "sample"; | ||
|
||
Deno.test(`correct legal update middle page sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.legalUpdateMiddlePageSum, 143); | ||
}); | ||
|
||
Deno.test("correct fixed update middle page sum for sample", async () => { | ||
const result = await main("sample"); | ||
Deno.test(`correct fixed update middle page sum for ${target}`, async () => { | ||
const result = await main(target); | ||
assertEquals(result.fixedUpdateMiddlePageSum, 123); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.