So I need to make a program that will store user and computer input into arrays, but when I print the results it only shows the last values inputted. I can't get the array to store all the values inputted by the user and the computer. here's part of the code:
do
{
String[] user = new String[100];
yourChoice = GetValidUserInput(promptString);
for(int u = 0; u < user.length; u++)
{
user[u] = yourChoice;
}
randomNum = (int) (Math.random() * 3);
String[] computer = new String[100];
computerChoice = GenerateComputerChoice(randomNum);
for(int c = 0; c < computer.length; c++)
{
computer[c] = computerChoice;
}
TheVictor(yourChoice, computerChoice);
decide = JOptionPane.showInputDialog("Would you like to play another game?");
if(decide.equals("no"))
{
Results(user, computer);
}
}while(!decide.equals("no") || decide.equals("yes"));