You have a

   a=.i.5

You want m

   m
1 3

Find a way to create it

   b=.5$0 1
   m=.b#i.5

   _1 m } a
0 _1 2 _1 4


2010/9/5 gary ng <[email protected]>

> Hi,
>
> What would be the recommended way to do this , say replace every
> element that is odd to '_1' ?
>
> 0 1 2 3 4 => 0 _1 2 _1 4
>
> I tried to under stand the 'm } ' verb but don't know how to generate
> the m based on a predicate.
>
> similarly how about replace the first n  with _1 ?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: [email protected]
gsm: +3546985532
sími: +3544781286
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.
         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |         (\_ _/)
  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
   `. )----'        (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to