Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is a class diagram for a system that support two people playing chess. This is not a model for chess program that determines which

Here is a class diagram for a system that support two people playing chess. This is not a model for chess program that determines which moves to make, but rather a program to facilitate two humans playing across the internet. As is usual with this type of arrangements, there is a timer. When one player makes a move, the time for the other player starts. If he/she does not make a move in that time period then, that player forfeits a move.

One twist that this system add is that there are actually 2 boards for each player, one real game board that is common to both players, and another private one in which a player can try out various moves.

Given this situation, draw a state chart to show the various states in which this system can be over time. Clearly one state will be when player one is making his/her move. The other player cannot be making an official move then. Vice versa, another state is when play two is making an official move.

However, the situation is made more complicated by the fact that player two can be experimenting with the practice board while it is players ones turn. In fact, player one can be experimenting with his/her practice board then also. And the time is continuing to click away the minutes. Thus, there are several things happening concurrently. Draw a State Chart that captures this system. image text in transcribed

ChessPlayer >commitMove name: String ne commit Move0 Real Board locked: Boolean nkForCurrent lockBoard0 not my turn unlock Board0 Chess Board makeMove(move) checkMoveValidity(move) scoreForBlack0 int scoreForWhite0:int resetBoard0 Chess Playingsystem startTimer0 resetTimer0 Timer timePeriodLength: int >commitMove name: String ne commit Move0 Real Board locked: Boolean nkForCurrent lockBoard0 not my turn unlock Board0 Chess Board makeMove(move) checkMoveValidity(move) scoreForBlack0 int scoreForWhite0:int resetBoard0 Chess Playingsystem startTimer0 resetTimer0 Timer timePeriodLength: int

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

How to reverse a Armstrong number by using double linked list ?

Answered: 1 week ago