/**
* Write a description of class Driver here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.util.*;
public class Driver
{ public static void main(String[ ] args)
{ Scanner keyboard = new Scanner(System.in); //for input
Die d1 = new Die();
Die d2 = new Die();
int sum;
int point;
boolean again = true;
do
{ //roll
d1.roll();
d2.roll();
System.out.println("results of your first roll:");
System.out.println("Die 1: " + d1.toString());
System.out.println("Die 2: " + d2.toString());
// System.out.println();
sum = d1.getFace() + d2.getFace();
System.out.println("the sum of your roll is " + sum);
if ( sum == 7 || sum == 11 )
{ System.out.println("you win!");
}
else if ( sum == 2 || sum == 3 || sum == 12 )
{ System.out.println("sorry, you lose");
}
else do
{ point = sum;
sum = 0;
d1.roll();
d2.roll();
System.out.println("results of your next roll:");
System.out.println("Die 1: " + d1.toString());
System.out.println("Die 2: " + d2.toString());
sum += d1.getFace() + d2.getFace();
if (point > sum)
{ System.out.println("BUST!");
}
else if ( point == 7 )
{ System.out.println("FAIL");
}
}
while ( sum != 7 && sum < point );
again = false;
}
while (again == true);
}
}