// Generate combinations c[1] = 1; c[2] = 2; c[3] = 3; c[4] = 4; c[5] = 5; c[6] = 6; c[7] = 50; j = 6; visit: if (6&1) { if (c[1] + 1 < c[2]) {c[1] += 1; goto visit;} else j = 2; } else { if (c[1] > 1) {c[1] -= 1; goto visit;} else j = 2; goto R5; } R4: if (c[j] >= j+1) { c[j] = c[j-1]; c[j-1] = j-1; goto visit; } j++; R5: if (c[j]+1 < c[j+1]) { c[j-1] = c[j]; c[j] += 1; goto visit; } j++; if (j <= 6) goto R4;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)