Re: [Jprogramming] adventofcode day 3

2015-12-15 Thread Linda Alvord
Why isn't the result 0 0 0 0 0 1 0 0 ? A=:'^' B=:'^' f=: 13 :'((|.|:|.4|+/~i.4),4|+/~i.4){y' f A v<^> <^>v ^>v< >v<^ ^ ^ v>^< >^mailto:[email protected]] On Behalf Of David Lambert Sent: Thursday, December 3, 2015 9:40 AM To: programming Subject: [Jprogramming] ad

Re: [Jprogramming] adventofcode day 3

2015-12-15 Thread bill lam
to see why, try this B="1 f A On Dec 15, 2015 7:57 PM, "Linda Alvord" wrote: > Why isn't the result 0 0 0 0 0 1 0 0 ? > > A=:'^' >B=:'^' >f=: 13 :'((|.|:|.4|+/~i.4),4|+/~i.4){y' >f A > v<^> > <^>v > ^>v< > >v<^ > ^ > ^ > v>^< > >^B-:"1 f A > 0 0 0 0 0 0 0 0 > > Linda > > -Ori

[Jprogramming] advent 15

2015-12-15 Thread Joe Bogner
brute forcing. I considered using math/misc/amoeba, but wasn't sure if it'd be a fit odometer=:#: i.@(*/) options=:(#~ (<&101)@:(+/"1)) odometer 101 101 101 101 arr=:;"1 (2,4,6,8,10) {"1 (<@(". :: (_"1))@((}:)^:(','={:)) );._1@(' '&,) every cutLF input parts=: (((0"_)^:(0>])"0) @: (+/)@:(arr * ])

Re: [Jprogramming] advent 15

2015-12-15 Thread Geoff Canyon
​I'm curious how fast J is to write for someone who knows what they're doing? In AdventOfCode only the first 100 submissions make the leaderboard, so speed is a premium. I dabble in J, but I'm *far* more comfortable in LiveCode, and that's what I use for AdventOfCode, although I sometimes go back

Re: [Jprogramming] advent 15

2015-12-15 Thread Joe Bogner
Geoff, Great question. I will answer briefly but this question may be more on-topic in chat, although reading the guidelines[1] your question is relevant to your learning or programming in J, so I'll give it a shot. To answer your question, I need to provide some structure to my response. "How fa

[Jprogramming] advent of code 15

2015-12-15 Thread David Lambert
Partitioning & inner product solve this. Instead of a clever partitioning algorithm, I recognized the problem is sufficiently small for my computer and used {3#followed by copy of the items with sums less than 101, stitched to whatever value would make the rank 1 sum come out to 100. -

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
Raul wrote (in the original thread): > Like this? > > cam=:2 :0 > u 5!:1<'v’ > ) > > Am=:1 :0 > u cam > ) Well … I wrote: > - It is tacit Not having it tacit defeats the purpose of the exercise: extending our tacit adverbial programming toolkit, so more J programs can be expressed mor

Re: [Jprogramming] advent 15

2015-12-15 Thread 'Pascal Jasmin' via Programming
My solution, in2 =. > ". leaf 2 5 8 11 {"1 ;:"1 ('-';'_') rplc~"1 a =. > cutLF wdclippaste '' rperm =: [: >@:(4 : ' map =. x ~: y [ o =. x ,"1 y for_j. i. {: $ map do. o =. o , (>:j) ({. , x , }.)"1 y #~ j{"1 map end. ~. o '&.>/) (a: -.~ [: , <"0@}./.~) , <@:({~ ([: (i.@! A. i.) #))@~. N

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Raul Miller
On Tue, Dec 15, 2015 at 11:32 AM, Dan Bron wrote: > Raul wrote (in the original thread): >> Like this? >> >> cam=:2 :0 >> u 5!:1<'v’ >> ) >> >> Am=:1 :0 >> u cam >> ) > > Well … > > I wrote: > >> - It is tacit > > Not having it tacit defeats the purpose of the exercise: extending our taci

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
Raul wrote: > Yeah... personally, I consider explicit code to be a subset of tacit code. I think of explicit and tacit as two distinct but related languages. That “:” is tacit doesn’t mean the programs written in it are tacit: I could (theoretically) write a tacit Lisp interpreter, but that does

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Jose Mario Quintana
Dan writes: " Pepe wrote: > PS. The adverb adv is intrinsically and proudly wicked; the writing a > purist version of Adv is left as an easy exercise for the reader ;) O, you almost had me, Pepe. You almost had me. *continues on quest for Holy Grail* " Against my best judgement :), a purist

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Jose Mario Quintana
Darn! One "o" went through, make a3=. (@: (aw f.)) ('av'f.) On Tue, Dec 15, 2015 at 6:31 PM, Jose Mario Quintana < [email protected]> wrote: > > > Dan writes: > " > Pepe wrote: > > PS. The adverb adv is intrinsically and proudly wicked; the writing a > > purist version of Adv is

Re: [Jprogramming] Tacit Toolkit (was dyadic J)

2015-12-15 Thread Dan Bron
> Against my best judgement :), a purist version of Adv follows, > assert 1 4 9 -: 1 2 3 *: av That’s so cool :) At some point we’re going to have to put our heads together and create a JAL addon to collect all these utilities. Named F^4, of course. -Dan ---

Re: [Jprogramming] adventofcode day 3

2015-12-15 Thread Linda A Alvord
Thanks, however it was a capital v in B. A=:'^' B=:'^' f=: 13 :'((|.|:|.4|+/~i.4),4|+/~i.4){y' f A v<^> <^>v ^>v< >v<^ ^ ^ v>^< >^mailto:[email protected]] On Behalf Of bill lam Sent: Tuesday, December 15, 2015 8:55 AM To: Programming forum Subject: Re: [Jprogrammin