You want as many points for crab as possible:you get points for crab for scoring into the pink goal, but you also dont want to let cpu score:cpu scores if the ball goes in the blue goal. The ball starts by moving vertically, then when crab touches it, it moves it direction by 3 degrees.
I give my credits to a scratch book. I saw someone doing it in class and thought its a good idea to make it myself.