Looping in Julia

When I run this code I get the error “distance (generic function with 2 methods)”

How do I make this work, please?