Lab 5

Chapter 6 - MATLAB Programs

Synopsis
In Lecture 6, we took a Modular Programming approach to outline a human vs. computer game of Tic-Tac-Toe. As we discussed, Modular Programming allows us to break apart a challenging task into smaller jobs that can be handled by separate functions. In this class, you will form teams of three to finalize the development of the Tic-Tac-Toe program. You will need to draw upon each of the tools in your programming toolbox to get the game functioning properly.


Daily Quiz

Quiz 10


Lab 5

You are inheriting a partially developed Tic-Tac-Toe program. You know that the main program is called tictactoe.m, and there are two associated functions called showmove.m and checkwinner.m. The two functions are known to work properly. Your job is to team up with two other students to identify and write the remaining functions. Begin by downloading the zip file below. Work through the main program to find the functions that need to be written. Lastly, be sure to add code to the main program that tells the user if there has been a win or tie.

lab5_20160224.zip

Answer Key

Code
lab5key_20160224.zip


Final Words

Modularity in program design is critical when working as part of a team. Each team member can independently work on a module that contributes to the overall function of the program. Modularity also allows us to easily replace individual components of our program to make it more efficient, more intelligent, and more versatile.