[wplug] OT - programming logic help

George Larson george.g.larson at gmail.com
Thu Apr 23 11:36:28 EDT 2009


On Thu, Apr 23, 2009 at 10:58 AM, Chris Romano <romano.chris at gmail.com> wrote:
> I'm trying to work through this and for some reason I just can't
> figure it out.  Lets see if I can explain this properly.
>
> I guess you can say that I'm working with fractals.  Say that I have 4
> values and I would to loop through all possible combination of those 4
> variables where the order is important.  That total number is 4! or
> 24.
>
> I'm coding this in php but any kind of pseudo code will work.  The
> number data points isn't static at 4, it will actually be between 5
> and 9, but 4 is an easier number to work with.
>
> Here are all the possible combos ... (it's easy to do on paper, just
> can't figure how to do this with code).
>
> 1       2       3       4
> 1       2       4       3
> 1       3       2       4
> 1       3       4       2
> 1       4       2       3
> 1       4       3       2
> 2       1       3       4
> 2       1       4       3
> 2       3       1       4
> 2       3       4       1
> 2       4       1       3
> 2       4       3       1
> 3       1       2       4
> 3       1       4       2
> 3       2       1       4
> 3       2       4       1
> 3       4       1       2
> 3       4       2       1
> 4       1       2       3
> 4       1       3       2
> 4       2       1       3
> 4       2       3       1
> 4       3       1       2
> 4       3       2       1
>
>
> Any help would be greatly appreciated,
>
> Chris
>
> --
> "They that would trade essential liberty for a little temporary safety
> deserve neither." -- Benjamin Franklin
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
>

I'm a little too busy to read the page thoroughly but I think you can,
at least, extrapolate what you want from this page:

http://www.dreamincode.net/forums/showtopic78984.htm


More information about the wplug mailing list