Othello
To start playing Othello, run the program by pressing Ctrl+Enter in the editor window. The game will ask you whether or not you want to read the rules and learn how to play the game. Next, the names of players for scoring purposes. The game will ask each player to enter a row and column on the board to place their piece. In order for a piece to be accepted by the game, the player’s chosen row and column must be valid according to the rules of Othello. If a player’s chosen spot for their piece is invalid the game will tell that player to pick a new row and column. The game will prompt the player to pick a new spot if they pick a spot with a piece already in it or if they pick a row or column less than 1 or greater than 8 (since those positions are outside the board). When a player traps the other player’s piece or line of pieces between two of their own pieces, the pieces in between are flipped to that player’s color. If a player has no available moves on their turn, they must enter “skip” to skip their turn. Players take turns flipping over each others pieces until the board is completely filled. At the end of the game, the player with the most pieces on the board wins. The game will then ask the players whether or not they want to play again. If the players enter yes, the game will restart. If they enter no, the game will end.
The program for Othello utilizes the file Othello.mat which is loaded into the game and contains the graphics for the Othello board and the functions responsible for placing pieces on the board. If the game is not working correctly when run, you must make sure that Othello.mat is downloaded and that MATLAB knows where to find the file.
Hangman
To begin playing Hangman, run the code. The game will randomly generate one of the many words written in the code. The game will then display 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, they will receive feedback. If the player is correct, then the letter will be filled into the blank and the player will be prompted to input another letter. If the player is incorrect, they will receive a message saying “Sorry, guess again”. The letter will then be displayed as a guess, and one of the eight chances will be removed. The player will be prompted to guess another letter. This process is repeated until the player has fully guessed the word.
Unlike classic hangman, there is no visible hangman being drawn. Instead, a strikes system has been put into place. Strikes are displayed as the player plays the game. The player starts the game with eight available strikes. If letters are guessed correctly, this does not effect the strikes. As the player incorrectly guess letters, however, the strikes count down. Once a player reaches zero strikes, the game is over.