Possible combinations of soccer results
Here's an alternative to recursion:

You have 3 different outcomes. You can assign each outcome to a digit in $[0, 1, 2]$. E.g. 0 means loosing, 1 means draw, 2 means win. 

Then you can represent one combination as a series of digits, e.g. $[1, 1, 2, 0, ...]$ (first two matches ended in a draw, the third one was won, ...). 
And you can interprete this series as the digits of a number in base 3. 

So obviously all combinations can be described using a number between $0$ and $3^{\#matches}-1$ and you can very easily iterate over them: 

for combination in 0 .. 3^(#matches)-1:
    results = combination in base 3 (exactly #matches digits)
    process results