On 2/28/07, Roger Hui <[EMAIL PROTECTED]> wrote:
This sounds like the "spread" or "n-up" verb
that was discussed recently under "Style and
Literacy in APL".

It's analogous, but up is simpler:

It would generate:

0  6 12
1  7 13
2  8 14
3  9 15
4 10
5 11

instead of

0  6 11
1  7 12
2  8 13
3  9 14
4 10 15
5

Oleg's approach seems like it will work, though I've
simplified it a bit, eliminating some unnecessary
operations and taking advantage of the fact that I
don't care if extra bogus entries appear after the end
of the list:

mv2=: [: ,@|:@($ ($ <:) [: +/\ ,)@|: [ > >[EMAIL PROTECTED] i.@, ]

And, yeah, I'm checking to see if I can get rid of
the requirement that padding be spread across
as many columns as possible.

Thanks,

--
Raul


http://www.jsoftware.com/pipermail/programming/2007-February/005240.html



----- Original Message -----
From: Raul Miller <[EMAIL PROTECTED]>
Date: Wednesday, February 28, 2007 9:21 am
Subject: Re: [Jprogramming] Something almost like i.

> On 2/28/07, Devon McCormick <[EMAIL PROTECTED]> wrote:
> > Maybe I need more coffee, but I'm not clear on what you're
> trying to do
> > here.
>
> I'm trying to arrange things in columns, visually.
>
> Physically, I'm arranging them left-to-right, top-to-bottom.
>
> However, I want the columns to appear to be arranged
> vertically.
>
> This is trivial when the total number of items matches divides
> evenly, but is a bit more complex when they don't (and I
> need the initial columns to be longer).
>
> Ultimately, since the data about what each of these things
> is split across several arrays, I think what I really want is
> the indices into those original arrays.  Thus, I wind up wanting
> indices arranged like:
>
> 0  6 11
> 1  7 12
> 2  8 13
> 3  9 14
> 4 10 15
> 5
>
> I don't really care what's in the two positions I left blank,
> because I'll never be referencing those indices.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to