Thanks for this. I just spent 30 minutes reading up on calculating pi with a simple Monte Carlo algo. Thinking about doing it d3.js...
If it was, say, a 4MHz machine, you both could be right.
It gets to 3.14 within a second, about 30 seconds to 3.1415.. and Ruby is surely doing this in 100x the time C or Java would.
Update: Also did it for JavaScript - https://gist.github.com/peterc/5019804
OK, so I was going to just do the unit circle thing. Then I got stuck in optimization mode. God I miss performance graphics programming.
It's a nice example but almost useless in practice.