/* *****************************************************************************
 *
 *  Description:  Client to create and animate an array of N
 *                bouncing balls.
 *
 *  Example:
 *  $ java-introcs BouncingBalls 10
 *
 **************************************************************************** */


public class BouncingBalls {
    public static void main(String[] args) {

        // read number of bouncing balls from command-line
        int n = ___________________________;

        // initialize standard drawing
        StdDraw.setXscale(-1.0, 1.0);
        StdDraw.setYscale(-1.0, 1.0);
        StdDraw.enableDoubleBuffering();

        // create an array of n balls
        Ball[] balls = _____________________;
        for (int i = 0; i < n; i++)
            balls[i] = ______________________;

        // do the animation loop
        while (true) {

            // gray background
            StdDraw.clear(StdDraw.GRAY);

            // draw and move n black balls
            StdDraw.setPenColor(StdDraw.BLACK);
            for (int i = 0; i < ____; i++) {
                _____________________________________;
                _____________________________________;
            }
            StdDraw.show();
            StdDraw.pause(20);
        }
    }
}
