[Tutor] calculation issue.

eryksun eryksun at gmail.com
Sun Aug 26 22:36:50 CEST 2012


On Sun, Aug 26, 2012 at 2:09 PM, Matthew Ngaha <chigga101 at gmail.com> wrote:
>
> heres the code: self.time_til_drop = int(new_pizza.height * 1.3 /
> Pizza.speed) + 1

height / speed is the number of steps it takes for a pizza to fall its
complete height. It sets time_til_drop to approximately 130% of that
number (with a +1 fudge factor in case the int() value is 0). It seems
this function is called at every step to decrement time_til_drop until
it's 0. Once it's 0, a new pizza is created to be dropped. The
designer wants a 30% buffer (in steps) between the time one pizza has
finished dropping and the creation of a new pizza.


More information about the Tutor mailing list