Coding challenge

Write some code that computes the average distance between two random points on different sides of a square that has a side length of 1. (Ans: 0.869...) (Ref: http://mathworld.wolfram.com/SquareLinePicking.html.)

Type your code here:


Lua reference

See your results here: