Hi I am doing the pi exercise in JuliaBox and would like to know how I could use the ternary operator ( a ? b : c ) correctly. Any suggestions?
Acircle = 0
Asquare = 0
for x in 1:N x,y = rand([-1:1]), rand([-1:1]) dist = sqrt(x^2 + y^2) dist < r ? Acircle++ : Asquare++ end return 4*(Acircle/Asquare)
N = 1000
r = 1
syntax: space not allowed after “:” used for quoting