title: Dice combinations to a total
body: <p>Trying to find a nice algorithm for working out d4 dice combinations for a total. For example 3 dice with four sides, all the combinations to make 4 would give: 004 013 112 022</p>
  <p>I will be using c# but python or pseudo would be great. Just need some help for the algorithm. Would always be a four sided die but total and number of dice would be parameters.</p>
  <p>Any ideas would be great. Thank you.</p>