Comment on: I have a problem with some Java code
Thanks for the help, but I'm still curious as to why my code was failing.
Comment on: I have a problem with some Java code
This is the complete code for the program, its a dice game called bunco where you gain points by dice rolls matching the round number, throwing three matching numbers, and throwing three matching numbers that match the round number. I added the extra x== z because the match 3 will occasionally give a + 5 even without anything matching but it still continues to do that.
Here is a link to the full code.
Comment on: I have a problem with some Java code
I'll post the complete code.
Comment on: I have a problem with some Java code
I'm stuck dealing with work stuff at the moment, some of my co-workers are computer science majors and I'll run it by them once we get settled down. I'll post whatever we find out.
Comment on: I have a problem with some Java code
This is the code preceding the else if, I don't see how it would effect i
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--;
}
Comment on: I have a problem with some Java code
They are all declared ints, this is the only position that adds a 5 to the value, other positions either add 1 or 21.
Comment on: I have a problem with some Java code
x, y, and z are all integers I added the x==z because it was failing occasionally.
Comment on: I have a problem with some Java code
I'm comparing the values of integers.
Comment on: I have a problem with some Java code
They are simple integers.
Thanks for the advice I'll keep that in mind for future projects. The assignment was to practice calling premade classes I didn't think to include the die.java when I posted my code. All the randomization happens there when the roll method is called.