/* i

/* * File: Yahtzee.java * —————— * This program will eventually play the Yahtzee game. */import java.util.ArrayList;import acm.io.*;import acm.program.*;import acm.util.*;public class Yahtzee extends GraphicsProgram implements YahtzeeConstants { public static void main(String args) { new Yahtzee().start(args); } public void run() { IODialog dialog = getDialog(); nPlayers = dialog.readInt(“Enter number of players”); playerNames = new StringnPlayers; for (int i = 1; i <= nPlayers; i++) { playerNamesi - 1 = dialog.readLine("Enter name for player " + i); } display = new YahtzeeDisplay(getGCanvas(), playerNames); playGame(); } private void playGame() { categories= new int N_CATEGORIESnPlayers; for (int i = 0 ; i 3){ return false; }else{ return true; } } private boolean isFourOfAKind() { int counter = 0; for (int i = 0; i < N_DICE-1; i++) { for (int j = 1; j 4){ return false; }else{ return true; } } private boolean isFullHouse() { int counter = 0; for (int i = 0; i < N_DICE-1; i++) { for (int j = 1; j 6){ return false; }else{ return true; } } private boolean isSmallStraight() { int counter =0; for (int i = 0 ; i =4){ return true; }else{ return false; } } private boolean isLargeStraight() { int counter =0; for (int i = 0 ; i