8 Queens

  1. Imagine there are 8 queens attending a race. On your computer screen each queen is represented by a character 'Q'. On each row there is one queen.
  2. Use a random number generator to determine which queen will move forward.
  3. Suppose the length of each lane is 50. The first queen who arrives at the destination wins the race.

The program may run as follows:
Running Q