F. Discussion

Blackjack:

After finalizing the game we wanted to code the first step of the process was deciding on the complexity of the game, the features to be added and the responsibilities for the team members.

Once decided, we needed a plan for which we created a flowchart. The flowchart mainly comprised of the layout of the code. This included what would be the flow of process which lead to 5 main outcomes and how each outcome would effect the variables when the game was restarted. Also, the flowchart comprised of where the loops would be placed.

Once the flowchart was set, major parts of the code were written separately and variables were set. This included dealing cards for the dealer as well as the player, calculating the total, effects of the outcome on variables etc.

The game started coming together when these separate buts of code were combined. This is what the game took shape and the first tests were conducted.

Wile the code worked it was full of glitches. The tests conducted showed glitches like total sums going over 21, failing to properly compare dealer total to the players total, the game getting stuck in an infinite loop etc.

We then had to examine every loop as most glitches occurred a result of wrongly coded loops. After correcting these loops most of the glitches were fixed. But there still remained a few minor glitches.

After which the game was played by us 100’s of times where if a glitch occurred we got to the bottom of it and fixed it. This kept going till the code was run multiple time and ran without any faults or glitches.

After the core of the game worked flawlessly we added other features improving playability. The entire game was put in a loop enabling the option to replay after every round. Other features like computing the bankroll were also added.

After which the secondary interview took place and we were instructed to add some visual effects. With the help of some online research on the Matlab discussion page we were able to add gifs to our game . On playing a different gif would show up after every possible outcome in the game. The interview requirements were met and the game was finally complete.

Mastermind:

Upon seeing the list of possible games we could create in Matlab, mastermind immediately caught my eye. This was because we all knew the game, and thought its mechanics were reasonable enough that it should be fairly straightforward to create without needing too much help, or getting too far out of our comfort zone and knowledge in Matlab.

After the decision to make the game, we just jumped right into to coding out the skeleton to the game, rather than focusing on writing out a flowchart, as we all knew the game already, so our main focus was trying to convert the rules we knew into code. For this process, we tried to create all the basic loops necessary, as we tried to differentiate which type of loop would work the best, as we knew this game would require a lot of them.

To start with, the game functioned, and produced outputs, but it was in lines of text, and there was no game board. The peg calculation also messed up often, and the game was extremely difficult to complete, but could be done.

Next, in the process of fixing the errors, rather than trying to get the most efficient code possible, we expanded the loops into separate loops, rather than loops within loops. This helped the debugging process tremendously, and allowed us to get the game to work right every item. The main issues we had were the priority of the black and white peg distribution, and resolving any errors or bugs within that loop.

The next process we went to tackle was the functionality and ease of use on the user. To do this, we needed to make a game board consisting of all the colors and pegs that have been guessed and distributed throughout the game, that constantly updates and stays in place as the game goes on. This was to make sure the user didn’t have to go back and check responses to their previous guesses.

To do this, we didn’t know how to fully use graphics and images, so we used loops and arrays to make a giant array for the “game board”. To do this, we made each and every relevant input into its own variable, and make a loop that iterated with the main guess loop so that it would add a row to the game board with that rounds feedback, thus solving our problem, and finishing our game.

Now, the game is in an easy to read format, and works perfectly as intended, every time, and produces the fun, stressful gameplay that the real games does.