barfooz.xyz

Advent of … — Day 12

Typescript

I think, I've reached quite fast a point where I have absolutely no Idea, what I should do to complete this day.

Here is my current state, which is not a working solution.

type StringToNumber<T extends string> = T extends `${infer N extends number}` ? N : never;
type NaughtyOrNice<Name extends string> = Name["length"] extends 0 ? "nice" : "naugthy";
type FormatNames<Name extends string[][]> = Array<{
	[K in keyof Name]: {
		name: Name[K]["0"];
		count: StringToNumber<Name[K]["2"]>;
		rating: NaughtyOrNice<Name[K]["0"]>;
	};
}>;

Code

Nothing new here. Yesterday, I've completed Day 6 and wrote some code for Part 6. But know that AdventOfTypescript is also taking some time to finish, it feels like work. 😩

Conclusion

For Day 13, I will check out AdventOfTypescript and if the solution is not clear to me on first sight, I will discontinue it. I will then try to focus more on AdventOfCode. Because I don't see the benefit of the types they expect me to write. Yes, there is something to learn, but too far away from an area where I will benefit from. If AdventOfCode gets too heavy for me, I will focus on my side projects and try to gain some progress there. For January, I have something planned. 😎


55 of #100DaysToOffload

#log #AdventOfCode #AdventOfTypescript

Thoughts? Discuss...