Added BallAlgorithm.java

A sample for the algorithm used in the Pong game.