diff options
Diffstat (limited to 'apps/plugins/puzzles/src/combi.c')
-rw-r--r-- | apps/plugins/puzzles/src/combi.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/apps/plugins/puzzles/src/combi.c b/apps/plugins/puzzles/src/combi.c index 3460183c9c..132d74027e 100644 --- a/apps/plugins/puzzles/src/combi.c +++ b/apps/plugins/puzzles/src/combi.c | |||
@@ -71,40 +71,3 @@ void free_combi(combi_ctx *combi) | |||
71 | sfree(combi->a); | 71 | sfree(combi->a); |
72 | sfree(combi); | 72 | sfree(combi); |
73 | } | 73 | } |
74 | |||
75 | /* compile this with: | ||
76 | * gcc -o combi.exe -DSTANDALONE_COMBI_TEST combi.c malloc.c | ||
77 | */ | ||
78 | #ifdef STANDALONE_COMBI_TEST | ||
79 | |||
80 | #include <stdio.h> | ||
81 | |||
82 | void fatal(const char *fmt, ...) | ||
83 | { | ||
84 | abort(); | ||
85 | } | ||
86 | |||
87 | int main(int argc, char *argv[]) | ||
88 | { | ||
89 | combi_ctx *c; | ||
90 | int i, r, n; | ||
91 | |||
92 | if (argc < 3) { | ||
93 | fprintf(stderr, "Usage: combi R N\n"); | ||
94 | exit(1); | ||
95 | } | ||
96 | |||
97 | r = atoi(argv[1]); n = atoi(argv[2]); | ||
98 | c = new_combi(r, n); | ||
99 | printf("combi %d of %d, %d elements.\n", c->r, c->n, c->total); | ||
100 | |||
101 | while (next_combi(c)) { | ||
102 | for (i = 0; i < c->r; i++) { | ||
103 | printf("%d ", c->a[i]); | ||
104 | } | ||
105 | printf("\n"); | ||
106 | } | ||
107 | free_combi(c); | ||
108 | } | ||
109 | |||
110 | #endif | ||