Pencil Code Reference > distance
distance shows the distance between two objects or locations.
t.distance(3, 4)
t.distance(s)
The following example uses distance(lastmousemove) to show the distance between the turtle and the mouse.
p = write "" forever -> p.html distance(lastmousemove)↑