Ad
  • Default User Avatar

    You can easily use a principel called "bail out fast"
    if(walk.length != 10){
    return false;
    }
    plus your way of calculating distance seems like a quick fix and not a maintainalbe solution :)