koozie / simple-article-spinner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple-article-spinner

Simple ruby script that finds all permuations from a list of two (2) to five (5) words supplied on the command line.

Job Description

from odesk.com

I need a program that takes TWO to FIVE inputs and returns them in all possible orders.

SO

For input A, B, C the return would be:

A B C C B A A C B C A B B A C B C A A B B A A C C A B C C B A B C

This should work with any string of words, so instead of A B C we have

Machine Great Buy

So it would return

Great Buy Machine Great Machine Buy Etc...

Examples

ruby bin/simple-article-spinner.rb A B C

Copyright 2012, Chris Stansbury

About

License:Other