First array practice:

1. Ask people in 4 seats for their names. Then slide them to the right and tell them who is in each seat.

Note: If you prefer, you can do a codingbat array problem instead of the second problem.

2. Simulate a carnival horse race game. Use a circle for each horse. Use a random number to move each horse across the stage.

a) first draw circles at .1,.2 and .1, .4 and .1, .6

b) make a new class variable of an array of Sprites variable to hold the locations of the horses (Sprite player[] = new Sprite[4];)

c) make a new boolean variable to indicate a winner was found, and set that variable to false when the game starts.

d) import the random number generator, create a class variable of type Random, and fill it with a generator.

e) override advanceFrame to move the x by a random number between 0 and .4

@Override
public void advanceFrame(double timePassed)

e) inside advanceFrame, get a random number for each player and move the player's circle over that far (by changing the x) , but always test to see whether there is a winner and stop.