public class SandL
{
  public static void main(String args[])
  {
    int nplayers;

    if (args.length != 1) // make sure there is exactly one command line argument
    {
      System.err.println("Usage: java SandL <number of players>");
      System.exit(1);
    }

    nplayers = Integer.parseInt(args[0]);
    SnLBoard board = new SnLBoard(nplayers);

    int sum = 0;
    for (int i = 0;i < 1; i++)
    {
      int moves = board.playGame(true);
      sum += moves;
      System.out.println("moves = " + moves + " sum = " + sum);
    } 
    double average = (double)sum / 100.0;
    System.out.println("Average game length = " + average);
  }
}
