Working on your programmer 'game'. Calc pi.
OK. I'm feeling pretty good right now. I was looking at stackoverflow and saw a question by Jon Skeet, "What is your most controversial Programming opinion". Someone posted that developers should know how to code and gave an example of an interview question to calculate pi. Wow. I have never seen the calc to generate PI before, so I gave it a whirl. Here's what I came up with in javascript:
I only did that in a few minutes, so I might code it differently if I wanted to do more iterations, but it worked for now.
And I also did the area calc for fun too:
And I also did the area calc for fun too:
Comments
Post a Comment