Everybody Codes: Melody Made of Code - Quest 1
Quest 1: Scales, Bags and a Bit of a Mess
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
https://everybody.codes/story/3/quests/1Open linkView original on lemmy.world
Futhark + sed
Futhark can read only number and array types from stdin, the input data is often a non-starter. Therefore, I often massage it into the right format using
sed.::: spoiler Sed Script
This formats everything nicely, e.g. the example for part 1:
is transformed into this:
:::
::: spoiler Futhark Solution
:::
I had hoped that the input might get big enough for optimization purposes, but the calculations are likely too simple.
I was expecting more CDEs and do re mis than I got. Thanks for letting me know this exists though!