public class TestCardDeck {
  public void run() {
    int i;
    int wins = 0;
    int ties = 0;
    int rounds = 10;
    /* The following two lines define a CardDeck variable and initialize 
       a new CardDeck */
    CardDeck d;//1
    d = new CardDeck(); //2
    for (i = 1; i <= rounds; i++) {
      Card player, computer; 
      player = d.draw(); //3
      System.out.print("Your draw: " + player + " "); //6
      computer = d.draw(); //5
      System.out.print("My draw: " + computer + " "); //7
      if (player.getValue() == computer.getValue()) { //8
        System.out.println("Tie");
        ties++;
      }
      else {
        if (player.getValue() > computer.getValue()) { //9 
	   System.out.println("You win");
           wins++;
        }
        else { 
	   System.out.println("I win");
	}
      }//end of outer else
    }//end of for loop
      System.out.println ("Your number of wins: " + wins + " My wins: " + 
      (rounds - (wins+ties) + " Ties: " + ties)); //10
  }  //run

  public static void main(String args[])
  {
    /* Look at how the main program remains similar */
    TestCardDeck myapp;
    myapp = new TestCardDeck();
    myapp.run();
  } // main
} // TestCardDeck

