Welcome Page

Table of Contents

Section 1: Project Management

A. Team Working Agreement

B. Individual Responsibility Agreement

C. Project Schedule

D. Meeting Notes

 

Section 2: Business Plan

A. User Identification and Interviews

B. Electronic/ Print Advertisement

C. Pitch Video With Demonstration

 

Section 3. Software Documentation For Mastermind

A. Introduction

B. User Manual

C. Program Description for Developers

D. Final Algorithm, Flowchart, or Pseudocode

E. Final Program with Comments

F. Discussion

G. Conclusions and Recommendations

H. References

 

Section 4. Software Documentation For GoFish

A. Introduction

B. User Manual

C. Program Description for Developers

D. Final Algorithm, Flowchart, or Pseudocode

E. Final Program with Comments

F. Discussion

G. Conclusions and Recommendations

H. References

 

Section 5. Software Documentation For Over7Under7

A. Introduction

B. User Manual

C. Program Description for Developers

D. Final Algorithm, Flowchart, or Pseudocode

E. Final Program with Comments

F. Discussion

G. Conclusions and Recommendations

H. References

 

Executive Summary

The intent of this lab was to create an online version of the game, ‘Mastermind’ using the program software MATLAB. The game Mastermind has a player trying to guess a random color that consists of four different colors. This code will be computer-generated and randomized each round of the computer game. This code incorporated several functions: while-loops, if-else-else statements, conditional statements, variable labeling, switch-case functions, input/ fprintf statements. This game would be beneficial as it teaches valuable problem-solving skills for all ages.

The game was successfully coded in MATLAB. The player is allowed to guess four colors they believe are apart of the computerized code. The player is allowed only ten turns to guess the turn. A while loop is created in order to ensure the game ends after 10 turns- or if the player guesses the correct code by the tenth turn. With each turn, the player was allowed to guess four colors, not repeating colors for each turn. After each turn, the code would output pegs to tell the player how close the guess was. If the player guesses the right color and the right placement in the computer code, then a black peg would be created on the board. If the player guesses the right color but it is in the wrong placement within the code, a white peg is outputted. If a player guesses a color that is not within the code, then no pegs are given for that guess. The number of pegs are dependent on the guess for each turn. They are placed on the board with the white pegs to the left of the black pegs and filling all the boxes from the left first. The column in which the peg shows in on the board has no correlation to the color in that same column. It is randomized, so the player must use other turns to find which color was correct.

Several complications were found during the creation of the game. Most of these were found through trial-and-error. The original while loop that continued the game was to run ten turns, but later it was realized a conditional statement was needed in case the player won before ten turns. There was another issue in the code. For each random code, a color was only used once. However, if the player were to guess the same color twice, the if-elseif-else loop creates an extra peg for the second guess. To fix this issue, the instructions, “Do not guess a color twice.” One problem in the middle of the project ended up taking two whole work days to fix. The uploaded variables for each color were large matrices. This was an issue because it was impossible to randomize a code while keeping each matrix intact. To fix this, a switch-case function was used twice in the code. Once was at the beginning to turn each color into a number that could referenced to and compared, and again at the end to revert the number back into matrices to be displayed on the board. By the end of the project, the assigned engineers on this project had to seek help from TA’s in order to create a functioning code to apply the black and white pegs to the board. A function was already created that counted how many black and white pegs were to be shown for each turn. To display this sum on the board, a loop was created to go through and, if the conditions allowed it, add a peg to the board a column at a time.

This game was ultimately successful. It created a game virtually that gives a challenge to several age groups. Because the game only allows ten turns and pegs are random in order, it takes effort to win- no matter how old. Rules and several situations were considered in the creation of this game. This created a more efficient code. However, there is one issue in the code that is acknowledged by the assigned engineers. In the case the player ignores the written instructions and guesses the same color twice, the if-elseif-else loop creates an extra peg for the second guess. This is a limitation in the game because if the player were to guess the same color twice, the code would not catch it. The incorrect number of pegs would still display. Further revisions are recommended in order to enforce this rule. However, if the instructions were considered, the code is still well-functioning and successfully creates a challenging game via MATLAB.