I am trying to learn how to script/program in mathematica and I am retyping some simple C and FORTRAN programs into Mathematica as a way to learn. I am writing a Monte Carlo code to calculate the value of pi. In the method attached a 10000x2 dimensional array is created using table with values ranging from 0 to 1. The magnitude of each row of the array is determined inside a For loop and if it is greater than 0 it is rejected and if it is less it is used in the running tally that is divided by the total number of points and then multiplied by 4 to give an estimate of pi. On top of calculating pi, I would like to create two more arrays to use in a list plot. In a second array I would like to store values of the first array that met the rejection criteria and in third array I would like to store values that were rejected, so I can plot the rejected points as red and the accepted points as blue. However, no matter what I try Mathematica will not seem to let me transfer points from the first array titled "vector". I am attaching the current code to this question that effectively calculates the estimate of pi. If anyone can show me how to transfer the rejected points to another array as determined inside the For loop I would be very grateful.
[counter, samples, a, vector, tally, pi, tally2]
counter = 1; samples = 10000;
tally = 1; a := Random[Real, {0, 1}];
Timing[vector = Table[a, {i, samples}, {j, 2}];
For[i = 1, i <= samples,
i++, {If[Norm[vector[[i]]] < 1, tally++, ""]}];
pi = (tally/samples)*4 // N]
`