B. User Manuel

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.

 

Hangman

To begin playing Hangman, run the Matlab code. The game will randomly generate one of the 36 words chosen from a word bank created on the following topics: Animals, countries, sports, sandwich toppings, colours and states. The game will then display a number of stars representing how many letters the player is required to guess, and prompt the player to guess a letter. The player will then input a letter. Depending on whether the player is correct or not, the figure gets filled up. If the player is correct, then the letter will replace the star and the player will be prompted to input another letter. If the player is incorrect, the figure slowly starts to fill, starting the head, body, etc. The player will be prompted to guess another letter. This process is repeated until the player has fully guessed the word or the player has one too many incorrect guesses and the hangman figure is complete.