public class Bunco
{
public static void main( String[] args)
{
int round1 = 1;
int round2 = 2;
int round3 = 3;
int round4 = 4;
int round5 = 5;
int round6 = 6;
int point = 0;
int point1 = 0;
int point2 = 0;
int point3 = 0;
int point4 = 0;
int point5 = 0;
int point6 = 0;
Die die1 = new Die();
Die die2 = new Die();
Die die3 = new Die();
System.out.println("Welcome to the Bunco Game");
//////////////////////////////////////////////////// Round 1 ////////////////////////////////////////////////////////////
System.out.println("ROUND 1");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round1 && y == round1 && z== round1)
{
point1 = point1 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y== z && x == z)
{
point1 = point1 + 5;
System.out.println(" mini-BUNCO!");
}
else{
if (x == round1)
{
point1++;
}
if (y == round1)
{
point1++;
}
if (z == round1)
{
point1++;
}
if (x != round1 && y != round1 && z!= round1)
{
counter--;
}
if (point1 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 1 is " + point1);
//////////////////////////////////////////////////// Round 2 ////////////////////////////////////////////////////////////
System.out.println("ROUND 2");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round2 && y == round2 && z== round2)
{
point2 = point2 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y== z && x == z)
{
point2 = point2 + 5;
System.out.println(" mini-BUNCO!");
}
else{
if (x == round2)
{
point2++;
}
if (y == round2)
{
point2++;
}
if (z == round2)
{
point2++;
}
if (x != round2 && y != round2 && z!= round2)
{
counter--;
}
if (point2 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 2 is " + point2);
//////////////////////////////////////////////////// Round 3 ////////////////////////////////////////////////////////////
System.out.println("ROUND 3");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round3 && y == round3 && z== round3)
{
point3 = point3 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y== z && x == z)
{
point3 = point3 + 5;
System.out.println(" mini-BUNCO!");
}
else {
if (x == round3)
{
point3++;
}
if (y == round3)
{
point3++;
}
if (z == round3)
{
point3++;
}
if (x != round3 && y != round3 && z!= round3)
{
counter--;
}
if (point3 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 3 is " + point3);
//////////////////////////////////////////////////// Round 4 ////////////////////////////////////////////////////////////
System.out.println("ROUND 4");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round4 && y == round4 && z== round4)
{
point4 = point4 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y== z && x == z)
{
point4 = point4 + 5;
System.out.println(" mini-BUNCO!");
}
else{
if (x == round4 )
{
point4++;
}
if (y == round4)
{
point4++;
}
if (z == round4)
{
point4++;
}
if (x != round4 && y != round4 && z!= round4)
{
counter--;
}
if (point4 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 4 is " + point4);
//////////////////////////////////////////////////// Round 5 ////////////////////////////////////////////////////////////
System.out.println("ROUND 5");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round5 && y == round5 && z== round5)
{
point5 = point5 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y== z && x == z)
{
point5 = point5 + 5;
System.out.println(" mini-BUNCO!");
}
else{
if (x == round5)
{
point5++;
}
if (y == round5)
{
point5++;
}
if (z == round5)
{
point5++;
}
if (x != round5 && y != round5 && z!= round5)
{
counter--;
}
if (point5 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 5 is " + point5);
//////////////////////////////////////////////////// Round 6 ////////////////////////////////////////////////////////////
System.out.println("ROUND 6");
for (int counter=1; counter>0;){
die1.roll();
die2.roll();
die3.roll();
int x = die1.getFaceValue();
int y = die2.getFaceValue();
int z = die3.getFaceValue();
if (x == round6 && y == round6 && z== round6)
{
point6 = point6 + 21;
counter--;
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
System.out.println(" BUNCO!");
}
else if ( x == y && y == z && x == z)
{
point6 = point6 + 5;
System.out.println(" mini-BUNCO!");
}
else{
if (x == round6 )
{
point6++;
}
if (y == round6)
{
point6++;
}
if (z == round6)
{
point6++;
}
if (x != round6 && y != round6 && z!= round6)
{
counter--;
}
if (point6 >= 21)
{
counter--;
}
System.out.println("You rolled a "+ x +" and a "+ y+" and a "+ z + " ");
}
}
System.out.println("Your score for round 6 is " + point6);
point = point1+point2+point3+point4+point5+point6;
System.out.println("Score for all rounds is " + point);
}
}