Berry: Difference between revisions

2 bytes added ,  7 December 2019
m
The calculation for the formula of berry growth in gen III when fully watered is incorrect. Should be changed to max-min + min instead.
(→‎Algorithm: Many different berries have a minimum yield of 1, not 2.)
m (The calculation for the formula of berry growth in gen III when fully watered is incorrect. Should be changed to max-min + min instead.)
Line 247: Line 247:
*''rand'' is an integer randomly chosen between 0 and <code>''max'' - ''min''</code>, inclusive
*''rand'' is an integer randomly chosen between 0 and <code>''max'' - ''min''</code>, inclusive
*''water'' is the number of growth stages during which the plant was watered
*''water'' is the number of growth stages during which the plant was watered
The difference between a Berry's maximum and minimum yield can range from 1 to 4, and there are 4 stages a Berry can be watered in. If the plant is fully watered (''water'' equals 4), then if ''rand'' equals <code>''max'' - ''min''</code>, the numerator is equal to <code>(''max'' - ''min'') × ''water''</code> and the denominator evenly divides ''water'', so that the formula evaluates to <code>''max'' - ''min'' + ''min''</code>, or ''max''. In short, there is a 1 in <code>''max'' - ''min'' + 1</code> chance that a Berry plant will provide its maximum yield if it is fully watered.
The difference between a Berry's maximum and minimum yield can range from 1 to 4, and there are 4 stages a Berry can be watered in. If the plant is fully watered (''water'' equals 4), then if ''rand'' equals <code>''max'' - ''min''</code>, the numerator is equal to <code>(''max'' - ''min'') × ''water''</code> and the denominator evenly divides ''water'', so that the formula evaluates to <code>''max'' - ''min'' + ''min''</code>, or ''max''. In short, there is a 1 in <code>''max'' - ''min'' + min</code> chance that a Berry plant will provide its maximum yield if it is fully watered.


=====Stages=====
=====Stages=====
4

edits