Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

it's in c++ not java and no code implementation just uml diagram In this variation of Othello, some positions on the board will be unplayable,

image text in transcribedimage text in transcribed

it's in c++ not java and no code implementation just uml diagram

In this variation of Othello, some positions on the board will be unplayable, and the starting position and the rules for flipping pieces may be different from the standard Othello game. The program should display the game board using ASCII characters on the screen, with positional labels along the top and side to allow players to input their moves using keyboard commands. The program will provide messages indicating the outcome of moves and instructions for the current player's turn at the start of each turn. The traditional Othello disks are shown in the assignment description, but the actual implementation should display ASCII characters. At the beginning of the game, a menu will be displayed with the following options: 1. Quit 2. Load a Game 3. Start a New Game If a player chooses to quit, the program should close. If the player chooses to load a game, the program should prompt for a filename. After loading the game, play will continue from where it left off. The format for saving and loading games will be provided in the subsequent assignment. If the player chooses to start a new game, the program will ask for the names of two players, and the game will begin. Please note that some squares on the board may be unplayable, and this rule is not part of the standard Othello game. However, the unplayable squares will remain the same in every game in the final implementation. When starting a new game, the player will be given several options for the starting position, and they will select one by entering a number corresponding to the desired choice: 1. Standard Starting Positions Figure 1: The standard Othello starting position. 2. Four-by-Four Starting Position Figure 2: A non-standard, but still centered Othello starting position. Regardless of whether the game is started from a new game or loaded from an existing game, the current player will have the following options: - If the current player cannot move, they may choose to save, concede the game or, if they cannot make a play to take an opponent's pieces they may forfeit their turn - A player may choose to save, concede or make a move At the end of the game, the Board should record the outcome of the game, including the identity of the losing or whether the game ended in a tie. An appropriate message should be displayed. Please create a UML class diagram that includes the classes Game, Board, Position, Piece, and Player. A Game object should have a Board object and the Board object should have Players. The Position class should be a parent class of UnplayablePosition. The Position class should have a virtual method named "canPlay()" that returns a boolean value indicating whether the position is playable or not. The return value should be "true" for empty playable positions and "false" for unplayable positions. The use of polymorphism is required and recommended in this design. There is some flexibility in the design approach, but the play() method should loop, and the Board class should store its pieces internally. The design should include methods to save the game, a static method to load the game, a makeMove method to make a move, and methods to determine if a move converts any pieces. Additionally, a method to check if there are any valid moves left is also necessary. Consider the game rules and problem when including any additional methods, being mindful of which methods should be public or private. The classes should have constructors to provide an overview of the life-cycle of the elements of the game or their construction

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago