Generate all combinations of a set/array with specific conditions
Let $k = 11$ in your problem, so we want to generate all sets with values in the range $0$ to $k$ and with between $1$ and $12$ elements. Then you can do the following:


First generate all sets for $k-1$ (recursively)
Then, for each set, make two copies, one with a $k$ on the end and one without a $k$ on the end.


If you prefer doing it iteratively, here is this described in an iterative fashion (pseudocode):

generate_all_subsets(k):
    let sets = [[0]]
    for i from 1 to k:
        for each set in sets:
            add sets + [k] to sets
            # (now there are two copies: sets, and sets + [k],
            #  so the size of 'sets' has doubled)
    return sets