diff options
Diffstat (limited to '11.c')
-rw-r--r-- | 11.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -95,6 +95,7 @@ main(int argc, char ** argv) int nmonkeys = 0; long i, j; int calming = 3, rounds = 20; + unsigned long test_mod = 1; while ((i = getopt(argc, argv, "p:c:r:")) != -1) { switch (i) { @@ -205,6 +206,8 @@ main(int argc, char ** argv) free(monkeys); return -1; } + + test_mod *= m->test_div; } // Perform monkey inspection rounds @@ -242,6 +245,8 @@ main(int argc, char ** argv) } *item /= calming; + *item %= test_mod; + catcher = *item % m->test_div ? m->test_false : m->test_true; monkey_additem(monkeys + catcher, *item); |