Let's create an activity diagram for the chess game.
We'll cover the following
An activity diagram is a great way to visualize the flow of messages from one activity to the other in the system. There can be different activity diagrams that we can create for our Chess game. In this lesson, we will create an activity diagram to show how to play chess.
Chess game
The following states and actions will be involved in this activity diagram.
States
Initial state: The player makes the first move.
Final state: Any of the game-over condition are met.
Actions
The player initiates a new game. The board appears, and the player takes a turn. The system validates the move, then system checks if any of the game-over conditions are applicable. If the game is not over, the other player takes his turn, and the game continues until any of the game-over conditions are met.
Based on the order above, the activity diagram of chess game is given below.