I need to finish this as soon as possible. If anyone would care to help, that would be great. The goal is to get to 50 points before you roll a 1, which sets your score back to zero. This is a single player game unless someone can assist me with making PIG a two player game. I changed it to 25 points to make the game go quicker. By the way, I programmed in Java and used JCreator.
Here's the code:
I guess first I have to ask, but why are you making this? Here at Java ranch one of the things we try to go by is DoYourOwnHomework. If that isn't what this is for but also realize that here we are NotACodeMill. We'll be glad to guide you, but we're not going to write anything for you past some pseudo code. And the other big issue is that your code is very difficult to read. Something like this needs to be in separate classes and methods, not just main. Your code also gets very far out at places, far past the general 80-120 character limit usually taught. We don't really want to read through something that long especially without, from my cursory glance mind, many comments. Some self commenting methods or pseudo code would greatly increase your chances of getting help, as that way we at least don't have to trudge through however many lines you threw up there.
Also, take another look at your incantation for "rolling the dice":
The expression (6-1+1) is equivalent to (6+1-1) which is equivalent to (6 + (1-1)) which is (6 + 0) which is just 6
A better way to do that is this:
If you keep the program the way it is right now where you have a lot of duplicated code, you'd have to change every line that has the same formula. This is the problem with duplicated code. As Fred suggested, you should extract the duplicated code to its own method and replace all the duplicated lines with a call to that method.
Practice only makes habit, only perfect practice makes perfect.—every music teacher ever
Practice mindfully by doing the right things and doing things right.— Junilu
Aside from what others have pointed out, "performanceTask" is not a good class name for two reasons. First of all, it does not follow Camel case. Secondly, it's not describing what your code is doing.
Follow proper indentations when presenting your code to others.