« first day (2828 days earlier)      last day (9 days later) » 

Ven
Ven
9:19 AM
o/, I have a general question I can phrase in a specific manner.
I'm working on https://codegolf.stackexchange.com/questions/276269/building-skyscrapers, and I ended up with this:

{⍸((⍵=2)×2|⍳⍴⍵)∨{(~2|+/⍵) (∨/2=⍵) 0[⍵[1]]}⌺3⊢⍵}

Now while this *works*, it doesn't very feel very array-ish, but I'm not sure how to refactor this best. I've also solved a challenge yesterday in which I did "selection", but not being able to make an array of functions I can index into and call messes with my brain.
Yesterday's challenge: https://codegolf.stackexchange.com/a/276250/8328
I have to short-circuit, I can't just compute both and `OR` them, because `2=0+.=(⍳⍵)` fails for the two elements case.
Input welcome :).
 
2 hours later…
11:23 AM
re golfing: you can change ⍵) (∨/2=⍵) 0[ to ⍵)(2∊⍵)0[ which knocks off a few chars
re making it more array-ish: you could generate the neighbours of each block and then check each pair of neighbours for each type of block, something like:

`{⍸(2|t)⊣@t⊢2∊¨@o(~2|+/)¨@z↓{⍵[0 2]}⌺3⊢⍵⊣z o t←⍸¨↓⍉⍵∘.=⍳3}`

but this is longer and only vaguely more array-ish
oh that can actually be one char shorter: (2|t)⊣@t(2|t)@t
Ven
Ven
11:54 AM
Oops, thanks, unspaced that :)
12:07 PM
don't forget the 2∊⍵ instead of ∨/2=⍵!
Ven
Ven
12:50 PM
Done, thanks again.
@Adám The link to QuadDiamond mode documentation seems broken on ?Dyalog_APL_Vision

« first day (2828 days earlier)      last day (9 days later) »