#include // Program to count how many 8 character combinations are necessary for brute force // Constants to remove magic numbers #define Z 25 int main (void) { static const short int max[26] = {4, 3, 3, 4, 4, 4, 4, 3, 3, 2, 3, 4, 3, 4, 4, 3, 1, 4, 5, 3, 4, 2, 3, 2, 3, 4}; // from STDERR of filter.pl short int have[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int combo = 0; int i, j, k, l, m, n, o, p; for (i = 0; i <= Z; i++) { if (++have[i] > max[i]) { --have[i]; continue; } for (j = i; j <= Z; j++) { if (++have[j] > max[j]) { --have[j]; continue; } for (k = j; k <= Z; k++) { if (++have[k] > max[k]) { --have[k]; continue; } for (l = k; l <= Z; l++) { if (++have[l] > max[l]) { --have[l]; continue; } for (m = l; m <= Z; m++) { if (++have[m] > max[m]) { --have[m]; continue; } for (n = m; n <= Z; n++) { if (++have[n] > max[n]) { --have[n]; continue; } for (o = n; o <= Z; o++) { if (++have[o] > max[o]) { --have[o]; continue; } for (p = o; p <= Z; p++) { if (++have[p] > max[p]) { --have[p]; continue; } ++combo; --have[p]; } --have[o]; } --have[n]; } --have[m]; } --have[l]; } --have[k]; } --have[j]; } --have[i]; } printf("%i\n", combo); return 0; }