Post Reply 
Programming puzzles: processing lists!
06-05-2017, 01:07 PM
Post: #119
RE: Programming puzzles: processing lists!
(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?

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


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



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