I'm trying to calculate the number of possible combinations of clothing for different types of characters in a game as well as listing those combinations or a PHP script to generate the filenames.
I have 5 different type of characters (mexican, asian, american, african).
There are 3 different sizes for each character (small, medium, large)
There are 9 different sets of clothing (shirt, shorts, shoes).
The gear are grouped into the following order:
Shirt (A) | X1 X2 X3 | Y1 Y2 Y3 | Z1 Z2 Z3
Short (B) | X1 X2 X3 | Y1 Y2 Y3 | Z1 Z2 Z3
Shoes (C) | X1 X2 X3 | Y1 Y2 Y3 | Z1 Z2 Z3
Small is X1 - X3, Medium is Y1 -Y3, Large is Z1 - Z3
You have to unlock each type of clothing in sequential order before the next one.
Each group (X, Y, Z) must have all items unlocked before moving forward.
-
1Exactly what are your question and what are your current attempt?MatsLindh– MatsLindh2012年08月06日 11:21:52 +00:00Commented Aug 6, 2012 at 11:21
-
15x3x9= number of combinationsWaygood– Waygood2012年08月06日 11:22:37 +00:00Commented Aug 6, 2012 at 11:22
-
@fiskfisk: I'd like to find the total number of combinations (as stated in first sentence) and if possible, a list of these combinations.Frank Gordon– Frank Gordon2012年08月06日 11:29:47 +00:00Commented Aug 6, 2012 at 11:29
-
so a mexican is not an american? As this is actually a mathematics question (You are asking for the number of Permutations you might want to go over to mathematics @Waygood already wrote the correct calculation for the number of possible permutations.dualed– dualed2012年08月06日 11:32:06 +00:00Commented Aug 6, 2012 at 11:32
-
No in this case american is not the same as mexican. The names of the character types are irrelevant. You could call them A, B, C, D instead. Waygood's answer is not taking the conditions at the bottom into account.Frank Gordon– Frank Gordon2012年08月06日 11:48:01 +00:00Commented Aug 6, 2012 at 11:48
1 Answer 1
For algorithms for producing all combinations, see Knuth The Art of Computer Programming, Volume 4, Fascicle 3: Generating All Combinations and Partitions