All pastes #203313 Raw Edit

Someone

public php v1 · immutable
#203313 ·published 2006-10-15 01:53 UTC
rendered paste body
 // Finish by bawnpa with help from aidan ##php@irc.freenode.net // Provided how many $widgets we need to produce, the below // function determines an amount that should be produced // considering we have $hours to manufacture the widgets. function distrib_production($widgets, $hours) {  $hourly_base = floor($widgets/$hours);  $overflow = $widgets-$hourly_base*$hours;  $array = array_fill(1, $hours, $hourly_base);  while ($overflow > 0) {    $i++;    $array[$i] = $array[$i] + 1;    $overflow--;  } // Cleanup unset($overflow); unset($i); unset($hourly_base); // return $array; }