Archive

Posts Tagged ‘mafia wars’

Thermodynamics applied to Mafia Wars!

Assume you have ‘x’ energy, and required-energy-to-do-a-job is yi (i=1,2,3,4,…) and experience reward per job is zi (i=1,2,3,4..). The most preferred job will be the one which gives maximum value for ((x-(x%yi))/yi)*zi; thermodynamically speaking this quantity is the exergy of the system – the maximum experience (work output) you can score by doing a job with the given energy.

I have made a bookmarklet for Firefox to compute the exergy here. Add the bookmarklet to your toolbar and click it on mafia wars job pages. The max. experience you can achieve from the available energy will be given under the jobs, which is the “most preferred job to do” at that time. This ain’t my original code, but adopted and edited from Spockholm mafia wars tools, and they own all the credits (except for the bugs and damages – no one including me owns or will be held responsible it). I would’ve released this code via a GPLv3 if I had coded it completely.

Foot Notes

x/y – division. For eg. 28/5=5.6, 25/5 =5.
x%y – modulus (remainder after division). For eg. 28%5 = 3, 25%5=0.
(x/y)*z won’t always give you the maximum experience. Only when the quantity (x/y) is a whole number – Mafia Wars doesn’t allow you to do 1.5 or 3.6 jobs, but 1 job or 3 job. So, (x-(x%y))/y times you can do a job when you have x amount of energy, and multiply it with experience rewards for that job to get the maximum experience you can gain.

Possibly Related Posts: