This is a raw prototype of list2, needs some fine-tuning.

   40 list 21{.nl_z_''
ARGV      CR        CRLF      DEL       
EAV       FF        FIXFONT   IF64      
IFCONSOLE IFJAVA    IFUNIX    IFWIN32   
IFWINCE   IFWINNT   JVERSION  LF        
Note      PROFILE   PROFONT   SYSPPC    
TAB                                     
   40 list2 21{.nl_z_''
ARGV      FIXFONT   IFWINCE   PROFONT  
CR        IF64      IFWINNT   SYSPPC   
CRLF      IFCONSOLE JVERSION  TAB      
DEL       IFJAVA    LF                 
EAV       IFUNIX    Note               
FF        IFWIN32   PROFILE            

   40 list 80+i.41
80  81  82  83  84  85  86  87  88  89  
90  91  92  93  94  95  96  97  98  99  
100 101 102 103 104 105 106 107 108 109 
110 111 112 113 114 115 116 117 118 119 
120                                     
   40 list2 80+i.41
 80  85  90  95 100 105 110 115 120
 81  86  91  96 101 106 111 116    
 82  87  92  97 102 107 112 117    
 83  88  93  98 103 108 113 118    
 84  89  94  99 104 109 114 119    


list2=: 3 : 0
  y list2~ {.wcsize''
:
  if. 0=#y do. i.0 0 return. end.
  m=. ":,.>y
  'n k'=. 0 1+$m
  c=. <.x % k
  r=. >.n % c
  z=. (-r) <\ m
  > ( ((>.&#){.[) ,.' ',. (>.&#){.] ) &.>/ z
)

--- Brian Schott <[EMAIL PROTECTED]> wrote:

> On Sat, 23 Jun 2007, Raul Miller wrote:
> 
> + On 6/23/07, Brian Schott <[EMAIL PROTECTED]> wrote:
> + >        The following example suggests the work of list from
> + > stdlib. Is there an existing alternative that organizes the
> + > results filling the columns first, instead of the rows?
> + >   ]test =: a.{~,(26$32,0),.(i.26)+~a. i. 'a'
> + >   15 list test
> +
> + I don't understand what you are asking, nor what you are trying
> + to do.  Could you expand on your question?
> +
> 
>       How about this example of what list produces,
> instead?
> 
>    ]test =: (1 j. [EMAIL PROTECTED])#a.{~(i.26)+~a. i. 'a'
> ab c def gh ijklm no pqrstu vwxyz
>    25 list test
> ab     c      def
> gh     ijklm  no
> pqrstu vwxyz
> 
>       What I want is something like the following but
> without the boxes, so it is more like list produces. Notice
> that the specimen words are alphabetical in the columns, not
> in the rows in my desired result.
> 
>    _3]\0 3 6 1 4 7 2 5{;:test
> +---+-----+------+
> |ab |gh   |pqrstu|
> +---+-----+------+
> |c  |ijklm|vwxyz |
> +---+-----+------+
> |def|no   |      |
> +---+-----+------+
> 
> 
> + I also wonder why you are using text with embedded null
> + characters?
> 
>       I thought the null characters would produce 2-letter
> cells, instead of 1-letter cells. Maybe that was
> inappropriate.
> 
> +
> + Thanks,
> +
> + --
> + Raul
> 
> Thank you,
> 
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 



      
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

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

Reply via email to