Search

Results include substring matches and semantically similar vals. Learn more
karfau avatar
aoc23_07
@karfau
https://adventofcode.com/2023/day/7
Script
https://adventofcode.com/2023/day/7
let verbose = true;
const CARDS = "23456789TJQKA";
const CARDSJ = "J23456789TQKA";
const ORDERC = "ABCDEFGHIJKLM";
const FIVE_OAK = 6;
const FOUR_OAK = 5;
const FULL_HOUSE = 4;
const THREE_OAK = 3;
const TWO_PAIRS = 2;
karfau avatar
aoc23_05
@karfau
https://adventofcode.com/2023/day/5 Oh boy, what a tedious one. I don't see any quick and easy optimization strategies here. the parsing is the most tedious part of this. The first part went way more smoothly than I initially thought, by splitting the different steps into smaller pieces. But the second part is a hard nut to crack. So many runtime/performance issues because the numbers are so "big" that my intail approach no longer works. Last nut I finally cracked was in v28 by running the following on a powerful desktop machine for nearly an hour: deno run https://esm.town/v/karfau/aoc23_05?v=28 (that is the module URL) to get the correct solution.
Script
Last nut I finally cracked was in v28 by running the following on a powerful desktop machine for nearly an hour:
`deno run https://esm.town/v/karfau/aoc23_05?v=28` (that is the module URL)
to get the correct solution.
vtdocs avatar
getGithubUserViaOctokit
@vtdocs
An interactive, runnable TypeScript val by vtdocs
Script
export const getGithubUserViaOctokit = async (username: string) => {
const { Octokit } = await import("npm:@octokit/core");
const octokit = new Octokit();
karfau avatar
aoc23_08
@karfau
https://adventofcode.com/2023/day/8 the script times out on val.town, so I ran it with deno on my machine for some mintes. By running deno run https://esm.town/v/karfau/aoc23_08 | grep z I observed a repeating pattern in the output... each "track" was reaching the same position over and over again, but not on the same lines. I dumped the beginning of the output into a text file, opened it to look at the patterns and confirmed that each "track" had a fixed frequency for each position ending on a Z. so I took the "step"(+1 because it's zero based) and checked the primes each of them contains, to get the correct input. I calculated that with a calculator and copied in the number.
Script
```bash
deno run https://esm.town/v/karfau/aoc23_08 | grep z
I observed a repeating pattern in the output...
3
Next