N = input(' Number of darts: N = ');
sum = 0;
for i = 1:N,
    y = rand(1,2);
    h = y(1)^2 + y(2)^2;
    if h <= 1
        sum = sum + 1;
    end
end
p = 4*sum/N
