thank you Raul, a bit cleaner/what I was looking for

>@,@:(<@;"1) ({.,"0 1 $:^:(1<L.)@}.)@>    (] <@; $:^:(1 < #)@-.)"1 0~ 0 1 2 3

it mirrors (,"0 1) the direct construction method as well.




----- Original Message -----
From: Raul Miller <rauldmil...@gmail.com>
To: Programming forum <programm...@jsoftware.com>
Sent: Monday, May 2, 2016 2:47 PM
Subject: Re: [Jprogramming] permutations the slow way

This, perhaps:

   ;"1 ({.,"0 1 $:^:(1<L.)@}.)@>    (] <@; $:^:(1 < #)@-.)"1 0~ 0 1 2 3

Sorry about the goof, earlier.

Thanks,

-- 
Raul




On Mon, May 2, 2016 at 2:40 PM, Raul Miller <rauldmil...@gmail.com> wrote:
> This, then, perhaps?
>
>    ([: ; <S:0)"1 ({.,.$:^:(2>L.)@}.)S:_1 (] <@; $:^:(1 < #)@-.)"1 0~ 0 1 2 3
>
> Thanks,
>
> --
> Raul
>
>
> On Mon, May 2, 2016 at 1:59 PM, 'Pascal Jasmin' via Programming
> <programm...@jsoftware.com> wrote:
>> It should also work with deeper trees.
>>
>> One way that avoids the tree building step is
>>
>> ,&.:(<"1)@:((] ,"0 1 $:^:(1 < #)@-.)"1 0~)  0 1 2 3
>>
>> but I also struggle with the tree walking approach that is say generated with
>>
>> (] <@; $:^:(1 < #)@-.)"1 0~ 0 1 2 3
>>
>>
>>
>> ----- Original Message -----
>> From: Raul Miller <rauldmil...@gmail.com>
>> To: Programming forum <programm...@jsoftware.com>
>> Sent: Monday, May 2, 2016 1:06 PM
>> Subject: Re: [Jprogramming] permutations the slow way
>>
>> This good enough?
>>
>>    ;"1 ({.,.>@}.)S:2 (] <@; $:^:(1 < #)@-.)"1 0~ 0 1 2
>>
>> Or did you have additional constraints?
>>
>> Thanks,
>>
>> --
>> Raul
>>
>>
>> On Mon, May 2, 2016 at 11:21 AM, 'Pascal Jasmin' via Programming
>> <programm...@jsoftware.com> wrote:
>>> how might you derive the unboxed permutation list from this tree?
>>>
>>> (] <@; $:^:(1 < #)@-.)"1 0~  0 1 2
>>> +---------------+---------------+---------------+
>>> |+-+-----+-----+|+-+-----+-----+|+-+-----+-----+|
>>> ||0|+-+-+|+-+-+|||1|+-+-+|+-+-+|||2|+-+-+|+-+-+||
>>> || ||1|2|||2|1|||| ||0|2|||2|0|||| ||0|1|||1|0|||
>>> || |+-+-+|+-+-+||| |+-+-+|+-+-+||| |+-+-+|+-+-+||
>>> |+-+-----+-----+|+-+-----+-----+|+-+-----+-----+|
>>> +---------------+---------------+---------------+
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
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