User Manual Othello

To begin playing Othello, the code must be ran in Matlab. The game will create a board for the game that is 8×8 with the center four spaces already filled with two spaces for each player, with spaces of the same number being diagonal to each other. The game will then prompt player two for their first input, which will be an x coordinate, then it will ask for a y coordinate. Once the player has given the program an input, the program will test if the input given is on the board, if it is on the board it will test if it is adjacent to another space that is already filled, as all moves must be made on adjacent spaces to a filled one, then it will test if it is a space that has already been taken, if the input from the player is either on a filled space, in a non adjacent space, or off the board the program will request another input until the player gives a valid input. The program will then take the valid input and place it on the board and test if there are any opposing player spaces between that new space and any other friendly space in the same row or column, and if there is, they will be switched to the same number as the player who just made the move. After the first player makes their move, the program will prompt the other player for their move, and run through the same tests. Once the game has gone back and forth until the entire board is filled, the program adds up how many of each number appears on the board, and the player with the most of the board with their number wins, and the program prints out the winner.

Leave a Reply

Your email address will not be published. Required fields are marked *