This is a program that controls a soccer-playing robot. The robot is a Lego Mindstorms robot. The program is written in Pynxc.  First the program scans the field to detect the ball. It does this by first scanning clockwise (OUT_C runs while OUT_A is stagnant) then scanning anti-clockwise (OUT_A runs while OUT_C is stagnant). This scanning process is performed by the function named "scan_for_ball()".  Then the program calculates the trajectory that will take it just behind the ball. This calculation is done by the function named "path_to_ball()".  The robot then moves according to the trajectory until it is just behind the ball. This movement is done by first moving vertically then moving horizontally. The distances had already been calculated by the function named "path_to_ball()".  A new trajectory is calculated that will take the ball towards tha goal. This calculation is done by the function named "path_to_goal()".  The robot then moves (while pushing the pull) according to the new trajectory until the ball is inside the goal. This movement is done by first moving vertically then moving horizontally. The distances had already been calculated by the function named "path_to_goal()".