Quest 5: Fishbone Order

  • 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

Link to participate: https://everybody.codes/

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 11 months ago* (last edited 11 months ago)

Uiua

[Works on test data, but fails on Part 3 live data: my checksum is "Correct length and correct first character". Posting for the record while I think about it more.] Turned out to be trailing zeros.

F ← (
  β†˜1βŠ™[0_0_0] # Create empty row
  ∧(
    ◑≑([βŠƒ(β†§βŠƒ(=0βŠ’β—Œ|>βŠ™βŠ‘β‚)|=0βŠ‘β‚β—Œ|β†§βŠƒ(=0βŠ£β—Œ|<βŠ™βŠ‘β‚))]) # Will it fit in each row?
    βŠŸβŠ™(⊒⊚)βŸœβŠ‘βŠ’βŠšβŠΈβ‰‘/β†₯                             # Find first non-zero row and col.
    (βœβŠ‘β‹…βˆ˜)βŠ™βŠƒβ‹…βˆ˜βˆ˜                                # insert
    β₯(ΛœβŠ‚0_0_0)¬≍0_0_0⊸⊣                        # Add padding row back
  )
  β†˜Β―1
)
S     ← β‹•/$"__"⊑1⍉
Part₁ ← S F
Partβ‚‚ ← -βŠƒ/↧/β†₯≑(S F)

Part₃ ← (
  ⬚0βŠΈβ‰‘(βŠ‚βŠƒ(S|≑(Β°βŠ₯β‚β‚€β–½βŠΈ>β‚€β‡Œ))F) # All sword stats
  β‰‘βŠ‚βŠ™(βŠ’β‰)             # Append sword IDs
  βŠβŠΈβ–                 # Sort
  /+Γ—+1Β°βŠβ‰‘βŠ£           # Checksum
)

Part₁ [58 5 3 7 8 9 10 4 5 7 8 8]
Partβ‚‚ [[2 7 9 9 3 8 3 8 8 6 8] [5 2 9 3 8 3 9 5 2 1 4]]
Part₃ [[1 7 1 9 1 6 9 8 3 7 2]
       [2 7 1 9 1 6 9 8 3 7 2]]
  • source