1. Homepage
  2. Programming
  3. A3-Implementing Othello

A3-Implementing Othello

Engage in a Conversation
Implementing OthelloUML

A3-Implementing Othello CourseNana.COM

Introduction
CourseNana.COM

A3-Implementing Othello CourseNana.COM

Stuart Thiel September 18, 2023 CourseNana.COM

This assignment is worth 5% of your grade. This is an individual assignment (so individual, I put your student ID on it) and you should not share your assignment with anyone else. The assignment is due Nov. 3rd at 11:59PM, Montreal time. CourseNana.COM

All submissions must go through Moodle. I like EAS, but the new VPN rules suck. CourseNana.COM

Q1) Implementing Othello ( 34 of grade)
Your assignment is to implement a variant of the game Othello according to the UML Class diagrams CourseNana.COM

provided below and the original rules specified in this link: CourseNana.COM

https://www.worldothello.org/about/about-othello/othello-rules/official-rules/english CourseNana.COM

You will be evaluated primarily on how playable your game is. You will also be evaluated on having followed the provided design. Lastly, and to a lesser extent, you will be evaluated on updates to the design diagrams that you make and the justification of any changes from the original design (preferably included as UML notes, but separate text may also be appropriate...keep it under two pages of text). CourseNana.COM

In this variant of Othello, some positions on the board will be unplayable. The starting position may vary, and the rules for flipping pieces may be adjusted. The class diagrams provided will show you the minimal object oriented approach that you should start with. You will likely add classes, and potentially even methods and fields. If you do so, these changes should be documented in updated UML diagrams. CourseNana.COM

The program should draw the board using ASCII characters on the screen. Positional labelling along the top and side will allow the input of movement coordinates via keyboard. Messages detailing the result of moves and instructions for how the current player may take their turn will be output by the program at the start of every turn. This assignment description shows traditional Othello disks, but the actual implementation would show ASCII characters. CourseNana.COM

When a game starts a menu will be shown, with numeric options given: CourseNana.COM

1. Start a New Game 2. Quit
3. Load a Game
CourseNana.COM

When the user chooses to start a new game, two player names should be requested before starting a new game with those two players as first and second player, respectively. If a user chooses to quit, the program should close. Should the user choose to load a game, the program should ask for a filename, load the game saved in that file, then continue from where that game left off. CourseNana.COM

When laying out the board before starting, note that the four center squares along the top row will be unplayable. This rule does not come from standard Othello, but keep in mind that such unplayable squares will be the same for every game, irrespective of starting position. CourseNana.COM

When starting a new game, the user will be offered different starting positions. They will enter a number corresponding to one of these choices: CourseNana.COM

1. Standard Starting Positions CourseNana.COM

Figure 1: The standard Othello starting position.
CourseNana.COM

2. An offset starting position, the user will be subsequently asked to choose a number between 1 and 4 to indicate one of the following options CourseNana.COM

1) A non-standard, offset starting position. 2) A non-standard, offset starting position. CourseNana.COM

3) A non-standard, offset starting position. 4) A non-standard, offset starting position. CourseNana.COM

Whether through starting a new game or loading an existing game, the current player will be given options to play: CourseNana.COM

The options for the current player are as follows: CourseNana.COM

• 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 CourseNana.COM

• A player may choose to save, concede or make a move CourseNana.COM

Games should be saved as a text file, with first, second and current player names on the first three lines, then all the characters in the board state on the last line. CourseNana.COM

When a game is over, an appropriate message should be displayed indicating the current board state, who won. CourseNana.COM

As per the diagrams, implement the classes Game, Board, Position and Player. A Game object should have a Board object and the Board object should have Players. The Position class should be abstract CourseNana.COM

with two subclasses, PlayablePosition and UnplayablePosition, inheriting from it. The Position class should have a pure 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. CourseNana.COM

There is some latitude on how one could approach the implementation, but one would want a play() method that loops. A makeMove method and methods to determine whether a move converts any pieces will be needed. A method to check if there are any valid moves left will be needed. Think about the game problem and rules and include any additional methods, mindful of what should be public and private. CourseNana.COM

Classes should use Constructors that make clear how the life-cycle of the elements of the game (or their construction) will work. CourseNana.COM

Consider the UML Notes when implenting, as there may be some guidance there. In particular, it has been noted that access/mutator methods are not shown/can be interpreted based on fields. CourseNana.COM

Q2) Othello Design ( 14 of grade)
Start with these diagrams and base your design on the shown structure. If you add classes, fields CourseNana.COM

or methods, include the updated diagram in your submission along with a brief (less than 500) word desription of that has changed. CourseNana.COM

While not shown in the diagrams, assume appropriate getters and setters, and interpret CourseNana.COM

Main Othello Design CourseNana.COM

+ Game(p1: Player, p2: Player) + start(): void CourseNana.COM

+ drawBoard(): void
+ load(): Board
+ Board(p1: Player, p2: Player, start: int) + Board(save_file: std::string)
+ play():void
- save():void
- takeTurn():void
CourseNana.COM

- name: String CourseNana.COM

+ Player(name: String) CourseNana.COM

-first CourseNana.COM

-current -second CourseNana.COM

Position CourseNana.COM

We will store all board po- sitions in here CourseNana.COM

Details of class Po- sition shown in next diagram CourseNana.COM

Othello Position Inheritance CourseNana.COM

Position CourseNana.COM

- piece: char CourseNana.COM

+ canPlay():bool = 0
+ const char EMPTY = ’ ’ + const char BLACK = ’B’ + const char WHITE = ’W’
CourseNana.COM

UnplayablePosition CourseNana.COM

+ const char UNPLAYABLE = ’*’ CourseNana.COM

+ canPlay():bool CourseNana.COM

PlayablePosition CourseNana.COM

+ canPlay():bool CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Implementing Othello代写,UML代写,Implementing Othello代编,UML代编,Implementing Othello代考,UML代考,Implementing Othellohelp,UMLhelp,Implementing Othello作业代写,UML作业代写,Implementing Othello编程代写,UML编程代写,Implementing Othelloprogramming help,UMLprogramming help,Implementing Othelloassignment help,UMLassignment help,Implementing Othellosolution,UMLsolution,