advent of code 2023: typo

This commit is contained in:
Wouter Groeneveld 2023-12-18 10:40:29 +01:00
parent bd3cf16126
commit ef5e9dea9c
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ I gave up after yesterday's quirky A* assignment. [Advent of Code](https://adven
As I approached the challenges, I wondered whether or not this was also a good opportunity to learn a new scripting language. I guess the answer again depends on the amount of daily free time you have. In my case, fighting with syntax and not knowing the definitive eloquent way to approach something in an ecosystem that is relatively new to me just took too much time. After trying out Ruby a few times, I reverted back to JavaScript, as the assignments themselves were already challenging enough. For the curious, [my code repository is public](https://git.brainbaking.com/wgroeneveld/adventofcode).
Quickly trying out syntax in the developer pane of a browser, such as `[...new Set([1, 1], [1, 2], [1, 1])]`, turned out to be key to a speedy victory. Like I mentioned in the [my ideal scripting language](/post/2023/12/my-ideal-scripting-language/) post, quick evaluation and _hackability_ are important feats to have if you want to get something done in a timely manner. You can't abuse `Set` to filter out similar arrays, by the way, but you can chat by `.toString()`-ing them. I cut a lot of corners to save time---as long as my unit test that verifies the example given in the assignment proved my algorithm worked, I didn't care.
Quickly trying out syntax in the developer pane of a browser, such as `[...new Set([1, 1], [1, 2], [1, 1])]`, turned out to be key to a speedy victory. Like I mentioned in the [my ideal scripting language](/post/2023/12/my-ideal-scripting-language/) post, quick evaluation and _hackability_ are important feats to have if you want to get something done in a timely manner. You can't abuse `Set` to filter out similar arrays, by the way, but you can cheat by `.toString()`-ing them. I cut a lot of corners to save time---as long as my unit test that verifies the example given in the assignment proved my algorithm worked, I didn't care.
Each Advent of Code assignment comes with two parts: part I is publicly available, and for part II, you have to create an account and sign in. Suffice to say, I skipped part II. Part II is usually the difficult part, where instead of input ranges in the hundreds, you're suddenly dealing with millions, meaning your brute force implementation will likely not work. However, if you only have a few hours a day (if that) to fiddle with a code assignment, and you also want to do this the Test First way, there's simply not enough time to do so.