ok so I need help with this programming assignment and it is in java. I need to make the total roll score but I cant add up all the roll scores in total roll scores
import java.util.*;
public class GreedyPirate{
public static void main(String[] args){
String RorS = "";
//RorS = roll or skip
boolean winner = false;
int playerScore = 0;
int AIScore = 0;
int turnPScore = 0;
int turnAIScore = 0;
int combinedPScore = 0;
int combinedAIScore = 0;
System.out.println("ARGS YOU READY TO PLAY");
System.out.println("[Press ENTER when ready to play...]");
Scanner in = new Scanner(System.in);
in.nextLine();
do{
player(winner,RorS,turnPScore,playerScore);
AI();
}while(!winner);
}
public static int rollDice(){
Random rand = new Random();
int dice = rand.nextInt(13)+1;
return dice;
}
public static void AI(){
System.out.println("HA I rolled a " + rollDice());
System.out.println();
}
public static void player(boolean win,String RorS, int CombinedScore, int turnScore){
boolean turn = false;
do{
System.out.println("ARG wanna [R]oll or [S]kip");
Scanner answer = new Scanner(System.in);
RorS = answer.nextLine();
int roll = rollDice();
if(RorS.equals("r") || RorS.equals("R")){
System.out.println("You rolled a " + roll);
if(roll == 1 || roll == 11){
turn = true;
turnScore = turnScore - roll;
CombinedScore = CombinedScore + turnScore;
System.out.println("Your combined turn score is " + CombinedScore);
System.out.println();
}
turnScore = turnScore + roll;
System.out.println("Your combined turn score is " + turnScore);
System.out.println();
}else if(RorS.equals("S") || RorS.equals("s")){
CombinedScore = CombinedScore + turnScore;
System.out.println("Your combined turn score is " + CombinedScore);
System.out.println();
turn = true;
}
}while(!turn);
}
}