March Madness/Day 8

So, I came back from a weekend away, and joined the #hacman IRC channel only to discover a slight problem. Nobody seems to know who (if anyone) is writing today's March Madness program. I'd had some ideas over the weekend, but I only had 2 hours free until I had to drive to Leeds, which wasn't enough time for anything ambitious.

When I was at school, and very much more of a maths-geek than I am now, I learned about the equations of motion. Whilst playing about with them, I realised that you could calculate the height of something by dropping a projectile from the top and timing how long it took to hit the ground. Thinking that this may be something which might impress girls, I committed the equation to memory.

So I found myself, in this hour of need, falling back on this knowledge, and I implemented a building height calculator in Javascript. It's easily the simplest program I've written in ages. It took me about 10 minutes from conception to completion, and several of those minutes were spent trying to find the Javascript reference files on my computer.

Here it is...

Added fact: The tallest building in the world is currently the Burj Khalifa in Dubai at 828m. If you dropped a stone from the top, it would fall for almost exactly 13 seconds!