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
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
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
(<"_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
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 ?
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:
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
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:
-/ <: #/.~ '()
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
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
> >
> >
> >
>
+/ (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
-/ #/.~ 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
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
--
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
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
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/
> > ---
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
>
---
http://adventofcode.com/
--
For information about J forums see http://www.jsoftware.com/forums.htm
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
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
20 matches
Mail list logo