This is for parents who can never get the kids to bed in time to make it to the first pub in a pub crawl.

(Where 'A' is the earliest time you can get a babysitter, 'B' is the actual time you can get your children to either, a) fall asleep or, b) be really comfortable with the fact that you are going
out on an excursion, the purpose, value and safety of which you’re unable to communicate to them, 'C' is the amount of time it will take you to work out which pub you can get to by the allotted time, given how late it is now you’ve achieved 'A' or 'B', 'D' is the actual time it will take you to reach your objective, allowing for the outrageously optimistic estimate you came up with for 'C', following the burst of elation having got to 'A' or 'B', 'E' is the Pub Real Arrival Time [PRAT] and 'F' is the Adjusted Pub Estimate [APE], which may need to be applied if 'E' is so close to the Fixed Arrival Real Time [FART – the pre-agreed arrival time for each pub] that you may as well head for the next one on the list):

If A > B ((and APE >(0.9 x (PRAT – A)) then PRAT = A + C + D + APE) else PRAT = A + C + D)
else
If ((APE >(0.9 x (PRAT – B)) then PRAT = B + C + D + APE) else PRAT = B + C + D)

Once you have determined PRAT, head for the pub with the nearest earlier FART and meet up with your fellow crawlers. There. Simple.

Sounds like a badly coded rant or at least a WIBNI. I tell you what, if you describe the application properly I can probably put something up on the web for you.

My doctor says I have an equation-repelling retina and what's known (apparently) as 'Alice/Bob Blindness', and I am therefore excused from reading this idea.

Judging from the title, though - isn't this what mobile phones are for?

Yup-- cellphones work fine for this. Anyway, pub crawls are supposed to be *fun*. Attempts to bring complex mathematical equations into it and get all worked up about getting drunk would seem to kill the point. Unless you really like equations, of course--but when I drink I do it to relax, not to calculate.

There's nothing wrong with the code. My wife and I regularly apply this simple formula with great success, ensuring we actually join a pub crawl at the correct pub to meet up with our friends. I think the only potentially contentious area relates to whether 0.9 can be uniformly applied, or whether the factor needs adjusting, depending on the scheduled length of stay in each pub on the crawl. I'm working on an enhanced formula, which takes this into account, using the Factored Uniform Drink Duration (FUDD).