Serry A.

asked • 04/26/21

This needs to be done in C programming using use structures to represent elements of the game, eg the board, the players, etc

create a program that manages a game of Othello for two players.

Your program should have the following functionality:

  1. Ask each player to provide their name as input from the keyboard and assign this name to the player;
  2. Assign players a disc colour;
  3. Keep track of each player’s score;
  4. Initialise the components of the game, eg initialise the board, initialise the score, set Black to be the first player to move;
  5. Request a move from each player in turn. A move should be entered at the keyboard. A move can either be p (for “Pass”) or in the format ld, where l is a letter in the range a to h, and d is a digit in the range 1 to 8;
  6. Check that the entered move is valid and, if it is, effect the move. If the move is not valid, request another move;
  7. A player should only be allowed to Pass if they have no valid move;
  8. Update and print the board after each move;
  9. When the game is over, establish which player has won, print out the winner, the score and the final board. The date and time of the game and the result of the game (ie the winner, the score) should also be appended to a file othello-results.txt.
  10. Note that the purpose of your program is to “manage” a game between two human players, not to develop playing strategies whereby the program can play against a human player.
  11. Also, it is not necessary to develop a graphical interface: all that is required is to take as input a player’s move from the keyboard and to print the board out on the screen using characters and strings. An example of the output to the screen is presented on the last page of this specification.


1 Expert Answer

By:

Patrick B. answered • 04/28/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.