Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java code all written in the main method Due to the various game - variables and match - variables, all the code should be contained
Java code all written in the main method
Due to the various gamevariables and matchvariables, all the code should be contained only within the main method. Other methods may be introduced to 'compartmentalize' code to facilitate readability and avoid repeating code unnecessarily; do not repeat code. However, since many gamematch variables need to change almost simulataneously and methods return only one variable, program development will be facilitated if all code is contained within the main method.
Example #: run with winner:
Welcome to the 'Shut the Box' Game.
Begin playing game #
Enter a seed:
The available numbers are:
The dice roll is and for a sum of
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The dice roll is and for a sum of
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The dice roll is and for a sum of
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The player may opt to roll die or dice because tiles and are "closed".
Enter to roll only die or or any other key to roll dice.
The dice roll is and for a sum of
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The player may opt to roll die or dice because tiles and are "closed".
Enter to roll only die or or any other key to roll dice.
The die roll is
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The player may opt to roll die or dice because tiles and are "closed".
Enter to roll only die or or any other key to roll dice.
The dice roll is and for a sum of
Which tiles should be "closed"? Separate multiple tiles with a space.
The available numbers are:
The player may opt to roll die or dice because tiles and are "closed".
Enter to roll only die or or any other key to roll dice.
The die roll is
Which tiles should be "closed"? Separate multiple tiles with a space.
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 with wins after rounds
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started