« first day (677 days earlier)      last day (1980 days later) » 

6:05 AM
@Adám while I'm just piling up the questions, anything about using .h files or imports, as several of the libraries I'm trying to use have massive header files that have definitions intended to be used throughout use of the library. Not just functions. So if anyone knows anything about that, or perhaps I just need to load the definitions straight from reading the file in and setting variables in APL?
 
 
3 hours later…
9:12 AM
@nathanrogers I'll compile your questions and see if I can get some answers.
 
 
2 hours later…
11:24 AM
@Jonah I do somewhat agree, yes when I was initially attempting the problem with apl, I knew I could almost instantly come up with an algorithm (ie transliterate the problem from english to code) for 1b in a lang like js, it was only after fiddling with it for a while when I could see another way of approaching the problem
this approach recognises that you only need to store the +` on the input list, while a solution like your ruby one doesn't know that and ends up with seen.length` to hold 143777 numbers, so I would say the apl/j solution actually has an advantage in this regard, ie more memory efficient
 
ngn
11:42 AM
@Cowsquack for those of us that don't speak j, could you explain briefly how it works, please?
 
here's my original apl solution, input's to the right ⊃{⍵/⍨⍵∊q}(⊢/q)∘+⍣(∨/q∊⊣)⊢q←+\∊
have you also been doing the advent of code challenges?
 
ngn
@Cowsquack i've only tried to do day 1 so far
 
what are your bytecounts for your solutions?
 
ngn
@Cowsquack i tried to do it in k in a more efficient way, not golfy
but i don't have a good solution yet
 
I have a matrix oriented solution for 1b (but it's way too bloated) ⊃(∊∘q(/⍨⍨)⊢)q+⌊/~∘0∊|(⊢×0=(⊢/q)∘|)∘.-⍨q←+\∊
 
ngn
11:47 AM
i was thinking of grouping the +\ by remainders mod +/
 
the matrix solution ^^ finds the smallest (positive) value of ∘.-⍨+\` into which +/` divides into, so appears to be similar to your idea
well finds which number in +\ that smallest value corresponds to
 
ngn
@Cowsquack hm, that's a large matrix
 
yes len×len, but I'm sure you can simply use one half of it
 
ngn
the input i got from adventofcode was ~1000 long and its sum was only ~500, so i thought it would make sense to split it into smaller problems
 
how so?
@ngn as was mine, but apl still does it almost instantly
 
ngn
11:56 AM
grouping by remainder would reduce it to ~100-200 of much smaller matrices
 
do you not only need the ones with remainder 0?
 
ngn
maybe i should get a working solution before i talk about this...
 
we also need much larger input to really test our attempts
 
 
2 hours later…
ngn
2:37 PM
@Cowsquack i tried to simplify your solution: ⊃q∩⍨q+⌊/d/⍨0=(⊢/q)|d←|∊q-¯1↓¨,\q←+\a
or with grouping by remainder: ⊃q∩⍨q+⌊/d/⍨0=(⊢/q)|d←|∊q{⊂⍵-¯1↓¨,\⍵}⌸⍨q|⍨⊢/q←+\a
 
3:25 PM
@ngn nice
 
3:51 PM
@Cowsquack "so I would say the apl/j solution actually has an advantage in this regard, ie more memory efficient" -- there's no doubt your solution is the better, deeper solution. my only point is that it's less "simple", and that (tacit) J seems to have trouble expressing a class of simple procedural problems that are trivially expressed with a while loop and a 2 or more temporary, mutating variables. These types of problems don't seem amenable to "array thinking", despite their simplicity.
 
That may not be as big a problem as it could seem. From my point of view, the languages that have simple procedural programs struggle to express trivial array solutions that you would see in J. To the same, or a greater, extent.
 
@H.PWiz, For sure. But even if J still dominates overall (and I love J), I still think it's a legitamate flaw. I haven't learned Jelly yet, but I suspect it provides a solution to this problem.
 
 
2 hours later…
5:29 PM
@Jonah I suppose you can't have a language that covers all aspects/paradigms
... or can you? cue vsauce theme song
 

« first day (677 days earlier)      last day (1980 days later) »