-/* Utility routines (SETBIT, TSTBIT, set_seed_from_time, get_next_lcg_value, randrange, RNDVOC, BUG) */
+/* Utility routines (SETBIT, TSTBIT, set_seed, get_next_lcg_value, randrange, RNDVOC, BUG) */
#undef SETBIT
long fSETBIT(long BIT) {
#define TSTBIT(MASK,BIT) fTSTBIT(MASK,BIT)
-void set_seed_from_time(void)
+void set_seed(long seedval)
{
- /* Use the current system time to get seed the ISO rand() function, from which we get a seed for the LCG. */
- srand(time(NULL));
- lcgstate.x = (unsigned long) rand() % lcgstate.m;
+ srand(seedval);
+ lcgstate.x = (unsigned long) rand() % lcgstate.m;
}
unsigned long get_next_lcg_value(void)
if(MAP2[1] == 0)MPINIT();
if (!oldstyle && SETUP)
- fputs("> ", stdout);
- IGNORE(fgets(raw_input,sizeof(INLINE)-1,OPENED));
+ fputs("> ", stdout);
+ do {
+ IGNORE(fgets(raw_input,sizeof(INLINE)-1,OPENED));
+ } while
+ /* allow comments in logfiles */
+ (!feof(OPENED) && raw_input[0] == '#');
if (feof(OPENED)) {
if (logfp)
fclose(logfp);