I'm trying to come up with a function that gives the number of evolutions possible given certain parameters, this is where I am so far.
A: Evolutions possible
Z: Candy needed to evolve said pokémon
X: Candy I have
Y: Number of the specified pokémon I have.
So this is where I get stuck.
A = (Y - ROUNDDOWN(X/Z) + X)/(Z + 1)
Reasoning:
Number of Pokémons I have (each worth one candy if transfered), subtract how many times I can evolve using only candy,
then add the amount of candy I have, divided by the amount of candy needed to evolve plus one (since I need one pokémon to evolve).
I'm about 90% certain that I missed quite a few things along the way, that's why I'm asking someone smarter for guidance!