F. Discussion

When considering which game our team wanted to develop we considered many factors. The two most important factors we discussed were: what challenges would we face when translating game play into code and most importantly which game would cause the most fun and enjoyment. Our team choose to develop Othello for MATLAB upon consideration of these two variables. Othello unlike many games such as hangman or connect four sacrifices very little of its enjoyment when played on the computer. Additionally Othello has relatively simple rules while simultaneously having a quite complex strategy which makes it easy to play and accessible to more people. Our team also considered the many challenges of translating the game into code. Othello was almost immediately considered for this project because of MATLAB’s easy and efficient way of dealing with matrices which the Othello board can be expressed as.

After deciding to develop Othello for MATLAB each team member played Othello noting with a heightened sensitivity the games logic and operation. After playing several games we decided to write a basic algorithm and flowchart to illustrate the basic architecture of our code. We came to understand the important aspects of the game: legal and illegal moves, capturing pieces, and ways to win. Every possible result (such as a legal move) was caused by the satisfaction of a certain condition or set of conditions that must be properly organized and we decided a flowchart was perfect for this.

First we understood that upon each move the program would have to determine if the move was legal. This was our first true coding challenge because for a move to be legal in Othello you must capture at least one of your opponent’s pieces. In order to capture a piece in Othello you must flank your opponent’s pieces on either side the issue was: you can capture pieces in more than one direction in the same move. Our programming team solved this problem by checking each move in all the eight possible directions if a move flanked enemy pieces.  If so the move would be determined legal and the flanked pieces would be captured.

The second major step in designing our game was determining a winner. There are two ways to win Othello: the first being to eliminate your enemy’s pieces from the board and the second to have a higher number of pieces at the end of the game. Both of these outcomes required a way to kind of counter to determine if or how many of each color pieces are present. This was built into the game with a function that goes from cell to cell to count the number of each color pieces. After this function was built we added a live scoreboard that counted the number of pieces after each move.

The last major challenge was encountered in our beta testing. This problem was if Player 1 cannot capture any pieces on their given turn then Player 2 must continue to move until there is a possible legal move for Player 1. This problem was quickly solved with an if statement that restored the proper order based on a lack of legal moves. The challenges we faced during the coding process were resolved through an understanding of the logic that serves as the basis of Othello which we then translated into code.