Find list of valid continuing positions in a game
Disclaimer: this is not a code review, but a suggestion for an alternative implementation.

First, there is not that many terminating positions (just num_players), so it seems easier to enumerate all positions, and filter the terminating ones out.

Second, given a position it is easy to generate lexicographically next one. In pseudocode,

    find the leftmost player holding non-zero amount of chips
    if it is the last player,
        we are done
    otherwise
        pass one chip to the next player, and
        give her remaining chips (if any) to player 0