Game Development Reference
In-Depth Information
Doing the Rat's Math
Put into a utility formula similar to what we have used earlier, we can express it as
follows. First, let's define our terms and the initial settings of the levers:
P r
Number of root beer lever presses
P q
Number of quinine lever presses
P qr
Number of lever presses per session
A r
Amount of root beer per press
A q
Amount of quinine per press
A qr
Amount of quinine and root beer to be consumed per session (thirst)
We also need a few formulas. Let's start small. We can glue them all together later.
The amount of liquid consumed is the number of presses for each multiplied
by how much liquid is dispensed for each:
The number of lever presses for root beer and quinine respectively add up
to the total number of lever presses:
We need to put everything in terms of quinine. Therefore, we are trying to
eliminate references to root beer in our equations. Obviously, the number of
presses for root beer will be the maximum number of lever presses minus how
many are used for quinine. To express this, we just need to flip the terms around:
Substituting into the original formula, we get:
Jumping through the hoops to solve for the number of presses of the quinine
lever () gives us:
Search WWH ::




Custom Search