Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Shut the box Please make sure the option to roll 1 dice is included once tiles 7 , 8 , 9 are closed!!! write a

Shut the box
Please make sure the option to roll 1 dice is included once tiles 7,8,9 are closed!!!
write a java file for this game do not use LISTs use ARRAYS and the String method
PLEASE follow started code and formating for output
the starter code is :
import java.util.Scanner;
import java.util.Random;
public class ShutTheBox {
public static void main(String[] args){
//************************** Put Your Code Here. ***************************
//Use this boolean static-method (class-method) to determine if some or all
//of the available tiles ('tiles') could possibly be arranged to sum to the
//dice roll ('roll'). The method outputs a boolean value (true or false).
???= ShutTheBox_HelperClass.continuePlaying(boolean[] tiles, int roll);
//**************************************************************************
}
}
the out put should be formated as such:
Begin playing game #1.
Enter a seed:
-44
The available number(s) are: 123456789
The dice roll is 6 and 5 for a sum of 11.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
38
The available number(s) are: 1245679
The dice roll is 6 and 3 for a sum of 9.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
9
The available number(s) are: 124567
The dice roll is 3 and 5 for a sum of 8.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
17
The available number(s) are: 2456
The player may opt to roll 1 die or 2 dice because tiles 7,8, and 9 are "closed".
Enter "1" to roll 1 only die or "2"(or any other key) to roll 2 dice.
2
The dice roll is 1 and 3 for a sum of 4.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
4
The available number(s) are: 256
The player may opt to roll 1 die or 2 dice because tiles 7,8, and 9 are "closed".
Enter "1" to roll 1 only die or "2"(or any other key) to roll 2 dice.
1
The die roll is 2.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
2
The available number(s) are: 56
The player may opt to roll 1 die or 2 dice because tiles 7,8, and 9 are "closed".
Enter "1" to roll 1 only die or "2"(or any other key) to roll 2 dice.
2
The dice roll is 4 and 2 for a sum of 6.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
6
The available number(s) are: 5
The player may opt to roll 1 die or 2 dice because tiles 7,8, and 9 are "closed".
Enter "1" to roll 1 only die or "2"(or any other key) to roll 2 dice.
1
The die roll is 5.
Which tile(s) should be "closed"? Separate multiple tiles with a space.
5
Congratulations, you won!
Do you wish to play again? Enter Yes to play again or anything else to quit.
No
Thank you for playing "Close the Box"! The total score is 0 with 1 win(s) after 1 round(s).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions