The entire point of this dice game is for a user to first roll four dice, if the answer to this roll is a 9,11,18 or 24 the user wins. If they roll a 6, 12, 13, 17, 19 or 23 the user loses. But if the user rolls any other number, that number becomes the goal number and they must roll it again to win, otherwise they roll a 13 and lose. I have most of this code established and functioning - the goal number is a little sketchy but more importatnly there is one more part of the code that I don't understand. For the final part of this code it is required that the user type either "1" to play the game manually as is or instead type "2" to let the computer play the game and the user is to input the amount of times for the computer to play, so basically how many times it shoud loop, displaying the results each time. Any help in understanding this would be greatly appreciated, I'm at a loss.

//Created 10/24/18
//Created by 
//Last Edited 11/9/18
//This is a programn used to simulate a dice game where four dice are rolled. If the numbers 9, 11, 18 or 24 are rolled the player wins. If 6, 12, 13, 17, 19 or 23 are rolled the player loses. Any other number rolled becomes the new goal number and must be rolled again in order to win.

import java.util.Scanner;
import java.util.Random;

public class P2A2_Ilovar_4182781{

// This portion of code simulates the rolling of dice.
    static int roll()
{
    int die1 = (int)(Math.random()*6) + 1;

    return die1;
}

static boolean playerWins(int dieSum)// This boolean method returns the values of the winning numbers rolled.
{
     return dieSum == 9 || dieSum == 11 || dieSum == 18 || dieSum == 24;
}

static boolean playerLoses(int dieSum)// This method is the exact same as the one above it, but this method is true when the sum of the dice equals the losing numbers.
   {
       return dieSum == 6 || dieSum == 12 || dieSum == 13 || dieSum == 17 || dieSum == 19 || dieSum == 23; 
}

static boolean playerSets(int dieSum)// This method is the exact same as the ones above it, but this method is true when the sum of the dice equals any of the goal numbers.
{
return dieSum == 22 || dieSum == 21 || dieSum == 20 || dieSum == 16 || dieSum == 15 || dieSum == 14 || dieSum == 10 || dieSum == 8 || dieSum == 7 || dieSum == 5 || dieSum == 4; 
}

public static void main(String[] args){
    Scanner in = new Scanner(System.in);

// Here the code prints out the rules and creator of the game.
System.out.println("Welcome to the CocoPanther Dice Game!");
System.out.println("Created by .");
System.out.println("In this game we will roll 4 dice. If you roll a 9,11,18 or 24 you win. But if you roll a 6, 12, 13, 17, 19 or 23 you lose.");
System.out.println("If you roll any other number that number becomes the new goal and if it is rolled you win. But if you roll an 13, you lose");
// Here the code asks and takes the name of the user.
System.out.println("What is your name?");
String inNext =in.nextLine();
System.out.println("Welcome,"+inNext);

// The code then performs an infinite loop to allow the user to roll the dice as many times as they want.
while(true)
{
    // The values of each die roll is stored here.
    String again = "y";
    int die1 = roll();
    int die2 = roll();
    int die3 = roll();
    int die4 = roll();

    Scanner keyboard = new Scanner(System.in);
    // Each value is then added to give the final number.
    int dieSum = die1 + die2 + die3 + die4;

    System.out.println("You've rolled a " +dieSum);

    // Here the code references the boolean methods from earlier, stating whether the user has won, lost or rolled a goal number.
    // Player wins portion.
   if(playerWins(dieSum))
    {
        System.out.print("Congratulations, you've won!");

    }
    // Player loses portion.
    if(playerLoses(dieSum))
    {
        System.out.println("Sorry, you've lost the game.");

    }
    // Goal number portion.
    if(playerSets(dieSum))
    {
        System.out.println("You've rolled a goal number! Roll it again to win.");

    }
    // This line simply allows the user to roll the dice again.
        System.out.println(" Roll them again (y=yes)? ");
        again = keyboard.nextLine();

    }
}

I share your confusion. The player doesn't actually play anything, just says OK and the computer rolls 4 dice and scores the result.
My best guess is that some user interaction mqy be used for the "roll again to win" case? In which case letting the cmputer play is the same as the user playing except that the user doesn't have to explicitly re-roll. and doesn't have to confirm having another go after each game.