Choosing fastest path to a point
I'm trying to make a program that will predict which directions to turn and get to a certain point by testing the directions and get the distance between the point and the program.The program will then choose the direction with the minimun distance and turn to that direction. When I first thought of this idea, I thought this was easy enough to do. However, that was easier said than done, as I'm struggling to find what I'm doing wrong or what I'm missing with it. Enough of that,here are the problems: 1.The program only turns one direction,making the program turn in a circle 2.The program would turn to the other direction when it's close to the point 3.I had an idea of making the program check the previous distance, but I had no idea on how to implement it at all. Here is the code: https://code.sololearn.com/WnYqO6eVJK5H/?ref=app