Also, I think the only reason it takes so long to calculate pi is because you are only making one calculation per act cycle. I tried it out using a for loop to calculate 100 times per act frame and the laptop I'm using handled it like pi (pun intended).
@SPower the way you calculate the arctan function is this arc(x) = x - x^3/3 + x^5/5 - x^7/7
Its just that pi/4 = arctan(1) or 1-1/3+1/5-1/7. So i think Zamoht's method is faster.
@Zamoht, I am impressed by your use of BigDecimals. I tried doing so but I had trouble with it. I will use some your code in my series formula scenario (I will give you credit and like your scenario).
Thanks, Builderboy, the Bresenham's line algorithm looks good. Though I do not understand why we need to know how to draw a line in java, since java.awt.graphics makes this easy.
That is what I thought. Not only is that slow, it hammers Greenfoot's network. Anyway, you could fix the problem by only setting the highscore after you die. That should work. (Essentially what SPower)
2012/7/4
BigDecimal Demo (pi calculator)
2012/7/4
BigDecimal Demo (pi calculator)
2012/7/4
BigDecimal Demo (pi calculator)
2012/7/3
Line Drawing
2012/7/3
Physics
2012/7/3
Tron with A.I.
2012/7/3
Line Drawing
2012/7/3
Falldown
2012/7/2
Physics