Difference for common/utils.c from version 1.1 to 1.2


version 1.1 version 1.2
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_utils_c =   * static char *rcsid_utils_c =
  *   "$Id: utils.c,v 1.1 2001/09/26 21:12:33 garbled Exp $";   *   "$Id: utils.c,v 1.2 2001/10/01 19:10:27 garbled Exp $";
  */   */
   
 /*  /*
Line 69
 
Line 69
  /* we have a winner */   /* we have a winner */
  ((luck > 0) ? (luck = 1) : (luck = -1));   ((luck > 0) ? (luck = 1) : (luck = -1));
  diff -= luck;   diff -= luck;
    if (diff < 1)
        return(omin); /*check again*/
  ((goodbad) ? (min += luck) : (diff));   ((goodbad) ? (min += luck) : (diff));
   
  return(MAX(omin, MIN(max, (RANDOM()%diff)+min)));   return(MAX(omin, MIN(max, (RANDOM()%diff)+min)));
Line 105
 
Line 107
      gotlucky++;       gotlucky++;
      ((luck > 0) ? (luck = 1) : (luck = -1));       ((luck > 0) ? (luck = 1) : (luck = -1));
      diff -= luck;       diff -= luck;
        if (diff < 1)
    return(omin); /*check again*/
      ((goodbad) ? (min += luck) : (diff));       ((goodbad) ? (min += luck) : (diff));
      total += MAX(1, MIN(size, (RANDOM()%diff)+min));       total += MAX(1, MIN(size, (RANDOM()%diff)+min));
  } else {   } else {
Line 125
 
Line 129
 {  {
   int diff;    int diff;
   
   diff = max - min;    diff = max - min + 1;
   if (max < 1 || diff < 1)    if (max < 1 || diff < 1)
     return(min);      return(min);
   


Legend:
line(s) removed in v.1.1 
line(s) changed
 line(s) added in v.1.2

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:19