« first day (2143 days earlier)      last day (512 days later) » 

 
3 hours later…
5:43 AM
Aoc Day8, too sad couldn't use stencil for this (or can I?)
 
 
1 hour later…
7:08 AM
Mine so far, room for simplification I think: gist.github.com/voidhawk42/b7f7749de7d0914634f2f14cbc12708d
 
 
2 hours later…
8:58 AM
Is there some iconic bool-array scan or reduction that sets all bits up to and including the first 1 (from the left) and zeroes the rest?
/me checks aplcart...
or-scan and-scan maybe
 
@xpqz <\∨∧\⍤~
 
0 1 0 1 → 1 1 0 0
@Adám Indeed. Nice.
 
I have all the "turn on/off after first…" but no "turn on/off before first…". Should add those.
 
 
3 hours later…
1:05 PM
@xpqz I did and-scan then take the minimum between 1++/ and length
 
1:23 PM
Its dual is (<\⍤~∨∧\) 1 1 0 1 1 1 ←→ 1 1 1 0 0 0 btw
 
 
3 hours later…
Ven
4:20 PM
o/
 
@Ven Long time no see!
 
Ven
Too long :)
 
Ven
4:41 PM
I'm looking for a way to distribute an argument, though I'm not sure that's possible
⎕←{l←2÷⍨≢⋄(l∘↑∊l∘↓)⍵}'abcdea'
⎕←{(3∘↑∊3∘↓)⍵}'abcdea'
⎕←{((2÷⍨≢⍵)∘↑∊(2÷⍨≢⍵)∘↓)⍵⋄1}'abcdea' ⍝ ugh
 
@Ven
0
1 0 0
1 0 0
 
Ven
(I'm trying to split the string in two elements of equal length)
 
(2÷⍨≢⍵)(↑∊↓)⍵ ?
 
Ven
Is that possible totally ⍵-free?
 
⊢(↑∊↓)⍨2÷⍨≢
-free is the dfnista's way to say tacit ;-)
 
Ven
4:46 PM
Trainful :-P.
 
You're wagoncome.
 
Ven
and now to integrate my filter, since I want (...↑∊↓...)/⍵, but then the ⍵ is not the version that's been cut in half, ugh
Maybe better to encapsulate that part into some kind of where
This is aoc22 day3, I want to get the letters that appear in both, and I couldn't find a better way than to split it halfway, ∊ one with another, and replicate
 
5:11 PM
with finding the letters that only exist in both, you can use intersection! so ⊢ (↑∩↓)⍨ 2÷⍨≢ or similar
codereport has videos for some of this year's advent of code - that's where I was reminded of ∩
 
 
4 hours later…
9:25 PM
@Adám nice gentle introduction to tacit notation.
 
Yeah, I thought it might be.
Btw, I have some ideas for you to make tomorrow's quest more interesting, as it is very trivial as-is.
 
nice :)
I finished the complete year already a few weeks ago. But that also gives me some time for AoC
 
Do you want the additional challenges now or at the event?
 
yes please
now
 
OK, so you'll get a nested structure where the leaf nodes are "strings" (i.e. character vectors). Return a similar structure, but each such vector replaced by a scalar indicating if it is valid DNA.
Another obvious extension is check if a given string is valid DNA or RNA, but not a mixture.
And then there's normalisation: ignore whitespace and case.
 
9:49 PM
@Adám you mean input like 'ACG' ('ACG' ('ACG' 'ACG'))
 
Yes, exactly.
The result here would be 1 (1 (1 1))
 
nice, will pick it up tomorrow. Have already an idea. Thanks!!
 
10:17 PM
If you have a array of size 4 and you want to apply a different function to each, is there a neater way than this?
{(⊃1⌷⍵)(⍉⌽⊃2⌷⍵)(⌽⊖⊃3⌷⍵)(⌽⍉⊃4⌷⍵)}
nb the functions are matrix rotations by multiples of 90, something like "apply f i times to item at index i" would work
 
@Lapwing482 Not quite the same but how about {⌽⍉⍵}\4⍴⊂m to get all 4 rotations?
 
@Lapwing482 At the very least, you can use 1⊃ instead of ⊃1⌷
 

« first day (2143 days earlier)      last day (512 days later) »