Lines Matching defs:penalty
281 * Initially, each number is charged a penalty of WRONGPENALTY, giving it that
283 * its penalty is decreased by one; it is removed when it reaches 0.
285 * The penalty[] array gives the sum of all penalties in the list for
290 static int penalty[sizeof(keylist) - 1][2];
291 static struct penalty {
292 int value, penalty; /* Penalised value and its penalty. */
293 struct penalty *next;
299 * Add a penalty for the number `value' to the list for operation `op',
301 * forget about the penalty (how likely is this, anyway?).
306 struct penalty *p;
313 penalty[op][operand] += p->penalty = WRONGPENALTY;
320 * as a value, or represents a position in the penalty list. If the latter,
321 * we find the corresponding value and return that, decreasing its penalty.
327 struct penalty **pp, *p;
330 value = random() % (maxval + penalty[op][operand]);
334 * are positions to be located in the penalty list.
341 * Find the penalty at position `value'; decrement its penalty and
345 if (p->penalty > value) {
347 penalty[op][operand]--;
348 if (--(p->penalty) <= 0) {
355 value -= p->penalty;
358 * We can only get here if the value from the penalty[] array doesn't