/* combinations.h generate all combinations of n things taken m at a time */ int combinations(int n, int m, int vn[], int vm[], int *first); /* return is 0 if more combinations to come. 1 if this is last */ /* n is for n things n! / ((n-m)! m!) combinations */ /* m is for m at a time */ /* vn must be the n items, unchanged by comb (can by pointers or indices) */ /* vm must be of size m items, the returned combination each call */ /* first must be 1 the first call, then set to internally */