7ab5fdd18691bba9ea1bbb42da4fb236c5d2cca6 kehayden Wed Apr 11 13:24:57 2012 -0700 KEH: corrected rand diff --git src/kehayden/alphaChain/alphaChain.c src/kehayden/alphaChain/alphaChain.c index 157e9e5..07029ab 100644 --- src/kehayden/alphaChain/alphaChain.c +++ src/kehayden/alphaChain/alphaChain.c @@ -397,25 +397,26 @@ FILE *f = mustOpen(outFile, "w"); int maxSize = min(wt->useCount, maxNonsenseSize); /* KEH NOTES: controls how many words we emit */ wordTreeMakeNonsense(wt, maxChainSize, pickRandomWord(wt->following), maxSize, f); carefulClose(&f); lmCleanup(&lm); // Not really needed since we're just going to exit. } int main(int argc, char *argv[]) /* Process command line. */ { +srand( (unsigned)time(0) ); optionInit(&argc, argv, options); if (argc != 3) usage(); maxChainSize = optionInt("size", maxChainSize); minUse = optionInt("minUse", minUse); maxNonsenseSize = optionInt("maxNonsenseSize", maxNonsenseSize); fullOnly = optionExists("fullOnly"); alphaChain(argv[1], argv[2]); return 0; }