Question
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.
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: intStep 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