Re: [Jprogramming] dyadic J

2015-12-01 Thread Don Kelly
I don't find the tacit versions easy to read and had to go over the explicit one liners to see what they are doing (divy is easier) but the easiest way to do this is to break up the statements and plug in the values What is missing in both-is that clarity of purpose and naming is not there at

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Joe Bogner
Hi gc, I realized we all posted solutions without giving you feedback as requested Some feedback: 1. My style is to eliminate parentheses as I find it harder to see the substance of the function (# - [: +:@(+/) '('&i.) '((()' is equivalent but with fewer parentheses I sometimes prefer trains

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread Raul Miller
On Tue, Dec 1, 2015 at 10:21 AM, 'Pascal Jasmin' via Programming wrote: > What would be a name for "_2 ? could it be item of items? After thinking about this... First, "_1 isn't "items" it's 'on items'. But the actual implementation uses numbers for a reason. So I'd be tempted to call the "_2

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Linda A Alvord
(<"_2 i.2 2 2 3)-:<"2 i.2 2 2 3 1 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of 'Pascal Jasmin' via Programming Sent: Tuesday, December 1, 2015 5:10 PM To: programm...@jsoftware.com Subject: Re: [J

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread 'Pascal Jasmin' via Programming
this expression makes more sense to me, +/"_2 i.2 3 4 your version is same as +/ i.2 3 4 - Original Message - From: Linda A Alvord To: programm...@jsoftware.com Sent: Tuesday, December 1, 2015 5:54 PM Subject: Re: [Jprogramming] if "_1 is item ... When are you applying rank _2 ?

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Ric Sherlock
Then you can't go to the basement? On Wed, Dec 2, 2015 at 11:41 AM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > or > > | -/ #/.~ S > > > > > - Original Message - > From: Ric Sherlock > To: Programming JForum > Sent: Tuesday, December 1, 2015 5:27 PM > Subject:

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread Linda A Alvord
When are you applying rank _2 ? <"_2 i. 2 3 4 T---T---┐ │0 1 2 3│4 5 6 7│8 9 10 11 │ +---+---+---+ │12 13 14 15│16 17 18 19│20 21 22 23│ L---+---+ +"_2/i.2 3 4 12 14 16 18 20 22 24 26 28 30 32 34

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread 'Pascal Jasmin' via Programming
or | -/ #/.~ S - Original Message - From: Ric Sherlock To: Programming JForum Sent: Tuesday, December 1, 2015 5:27 PM Subject: Re: [Jprogramming] 'Tis the Season... Nice idea but is dependent on the order of then input. -/ #/.~ ')', S _73 This would sort that: -/ <: #/.~ '()

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Ric Sherlock
Nice idea but is dependent on the order of then input. -/ #/.~ ')', S _73 This would sort that: -/ <: #/.~ '()' , S On Wed, Dec 2, 2015 at 11:09 AM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > -/ #/.~ S > > > > > - Original Message - > From: Geoff Canyon

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Ric Sherlock
mine was similar to Joe's floor=: [: +/@:<: ') ('&i. On Wed, Dec 2, 2015 at 11:17 AM, Joe Bogner wrote: > +/ (1,_1) {~ '()' i. S > > or > > +/ _1 + ') (' i. S > > On Tue, Dec 1, 2015 at 5:09 PM, 'Pascal Jasmin' via Programming < > programm...@jsoftware.com> wrote: > > > -/ #/.~ S > > > > > > >

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Joe Bogner
+/ (1,_1) {~ '()' i. S or +/ _1 + ') (' i. S On Tue, Dec 1, 2015 at 5:09 PM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > -/ #/.~ S > > > > > - Original Message - > From: Geoff Canyon > To: programm...@jsoftware.com > Sent: Tuesday, December 1, 2015 5:05 PM > S

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread 'Pascal Jasmin' via Programming
-/ #/.~ S - Original Message - From: Geoff Canyon To: programm...@jsoftware.com Sent: Tuesday, December 1, 2015 5:05 PM Subject: Re: [Jprogramming] 'Tis the Season... Spoiler (my solution, looking for feedback) . . . . . . . . F =: #-(+:@(+/@('('&i.))) If S is the string from the s

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Geoff Canyon
Spoiler (my solution, looking for feedback) . . . . . . . . F =: #-(+:@(+/@('('&i.))) If S is the string from the site, then F S returns the ending floor (the first part of the challenge). Any suggestions on improving the syntax are welcome, I only dabble in J. thx gc --

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread 'Pascal Jasmin' via Programming
I think item of items seems to work <"_2 i. 2 2 2 3 +++ |0 1 2 |6 7 8 | |3 4 5 |9 10 11 | +++ |12 13 14|18 19 20| |15 16 17|21 22 23| +++ <"_2 i. 2 2 3 +-+---+ |0 1 2|3 4 5 | +-+---+ |6 7 8|9 10 11| +-+---+ <"_2 i. 2

Re: [Jprogramming] if "_1 is item ...

2015-12-01 Thread Dan Bron
Tabulation (table of “something”, where “something” can be of arbitrary rank). -Dan > On Dec 1, 2015, at 10:21 AM, 'Pascal Jasmin' via Programming > wrote: > > What would be a name for "_2 ? could it be item of items? > -- > F

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Thomas Costigliola
Yes, it was! I'm hopping it gets harder. On Tue, Dec 1, 2015 at 2:26 PM, Joe Bogner wrote: > fun! day 1 was easily solved with J > > On Tue, Dec 1, 2015 at 2:02 PM, Thomas Costigliola > wrote: > > > http://adventofcode.com/ > > ---

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Joe Bogner
fun! day 1 was easily solved with J On Tue, Dec 1, 2015 at 2:02 PM, Thomas Costigliola wrote: > http://adventofcode.com/ > -- > For information about J forums see http://www.jsoftware.com/forums.htm > ---

[Jprogramming] 'Tis the Season...

2015-12-01 Thread Thomas Costigliola
http://adventofcode.com/ -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Quadratic formula

2015-12-01 Thread Jose Mario Quintana
You are right Linda, the code I wrote works only when both roots are real because + means conjugate in J. For a more general verb one can replace + by ] in the definition of qr; that is, qr=. (-@:B + (] , -) @:%:@:(*:@:B - 4 * A * C)) % 2 * A So, quad 1 0 1 0j1 0j_1 When (C ~: 0), I pref

[Jprogramming] if "_1 is item ...

2015-12-01 Thread 'Pascal Jasmin' via Programming
What would be a name for "_2 ? could it be item of items? -- For information about J forums see http://www.jsoftware.com/forums.htm