I am stuck on a difficult problem (for me), maybe someone can help?
I try to display how many monsters are in every stack before battle. The formula is:
Code:
m := nNeutrals / nStacks;
b := nStacks * (m + 1) - nNeutrals;
a := nStacks - b;
a stand for how many stacks will contain (m + 1) creatures,
b - how many stacks will contain m creatures.
Example from alexsp (HC): we have 40 monsters divided in 7 stacks.
Code:
nNeutrals = 40, nStacks = 7
m = 40 / 7 = 5
b = 7 * (5 + 1) - 40 = 2
a = 7 - 2 = 5
So, we have a = 5 stacks with m + 1 = 6 monsters, and b = 2 stacks with m = 5 monsters:
6 6 6 6 6 5 5
Now, in erm:
now I have to find how many possibilities there are, as I don't know the result of neither m, b or a. And I am stuck here, my maths are terrible.
Because now I have to assign a y var to z2-z8, then place in dialog items 2-8 (textes holding numbers), like DL561:A2/3/z2/1, where z2 contains the numbers of the 1 stack. If I can find a formula for seven stacks, then I can apply it to 3-7 stacks as well.
Example of 2 stacks formula working (very easy, if only everything was like that))