Page 1 of 1

1, 2 and 3 combinations

Posted: Thu Jul 29, 2010 7:46 pm
by lenton
If i had this string to show how many numbers there were:
$numbers = 3;
This would mean that I have the numbers 1,2,3.

How would I put them into this order and combination:
I want the shortest combinations first and the lowest number first when possible.
I do not want combinations with two of the same number.
I also need the points between numbers as i later will explode it into an array.

1
2
3
1.2
1.3
2.1
2.3
3.1
3.2
1.2.3
1.3.2
2.1.3
2.3.1
3.1.2
3.2.1

Thank you for you help!

Re: 1, 2 and 3 combinations

Posted: Fri Jul 30, 2010 11:28 am
by pickle
Doesn't sound like you want help, it sounds like you want us to do your work for you. This sounds an awfully lot like a homework assignment.

Have a go at it yourself & post questions about specific problems - don't ask for solutions to your whole project.