The bug is not in the code but the percentages displayed that get quite distorted when you are talking about 25% chances.
I have a vague recollection of a character advancing two levels when I fed it 10 heroes but I cannot be sure. If so, then it won’t matter. Based on my experiences above, I think the program runs the same routine 10 times rather than one routine with a variable number of cards.