I'm having slight problem.
I made a bet with my friend who could calculate PI the coolest way.
He uses the formula: pi= (4/1 - 4/3) + (4/5 - 4/7) + (4/9 + 4/11) etc. He doesn't know scripting btw.
I thought of a way cooler one.
I make a program in a 2x2 window(I will scale it eventually) and make a circle in it with r = 1, in the centre
Every calculation, I make a random x and y coordinate, (1.45 ; 0.854) for example. If it's inside the circle, I add 1 to var a. If it's outside the circle, I add 1 to var b. var c = a + b. Using Pythagoras I calculate the distance between the point and the centre, and if it's lower than 1, it's inside the circle. Now, there are two problems with thiso
1) The random numbers appear to not be fully random, and they have only 6 decimals or so. My brother said I might need to use prime numbers, but I don't know how to use them.
2) I have a max of 120fps, so 120 calculations per second.
Does anyone have a solution to any of my 2 problems?
