First, the objective is not to use formulas for combinations, or permutations.
The objective is to use loops(for, while, etc.) to make mathematica count the number of possible variations/sequences of the following situation:
Let’s assume we have a bag with $n$ balls, with $c$ different colours, and $d$ draws from the bag. There is no replacement, and you can consider separately the case when the order is important, and when it’s not.
For this question, I appreciate readability more than efficiency.