Post Reply 
Programming puzzles: processing lists!
06-05-2017, 01:42 PM
Post: #120
RE: Programming puzzles: processing lists!
(06-05-2017 01:07 PM)pier4r Wrote:  
(06-05-2017 11:48 AM)Gilles59 Wrote:  I agree ;D

What about a DOPERM command to handle list permutations.
Something like :

Code:


INPUT
 { 1 2 3 4 }             @ A list
 2                       @ Number of elements for permutation
 << My program >>        @ to handle each permutation
DOPERM
 
OUPUT (If MyProgram does nothing}
{ {1, 2}, {1, 3}, {1, 4},{2, 1}, {2, 3}, {2, 4},{3, 1}, {3, 2}, {3, 4},{4, 1}, {4, 2}, {4, 3} }

actually that is one of the challenges. To write a program that gives you all the permutations of a list (sure, when the list is large it may hog the system).

But I did not find any DOPERM on the AUR. Where do you get this command from?

As far I know this command does not exist neither in the AUR nor in a Library :/

I wrote such a thing far ago in User RPL but it was awfully slow and very badly coded! It will be great if somebody can create this in sysRPL.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming puzzles: processing lists! - Gilles59 - 06-05-2017 01:42 PM



User(s) browsing this thread: 1 Guest(s)