Here is the frog problem code I wrote in an Edinburgh pub.
Feel free to make better version. This one has not changed since I wrote it. V1 was the same code but saved before I changed it to work for different distances so I have not bothered upload it as well (it was still very unifinished).
Video is here: https://youtu.be/ZLTyX4zL2Fc