F. Discussion

Discussion for Connect 4 Game

During the beta testing of this MATLAB version of Connect 4, the game had not yet been finished. Two players could play, and their turns would display on the Connect 4 board just fine, but the program could not determine a winner. Also, the instructions were unclear as to where the players should place their chips and how to play. The coding for this game was intense, especially concerning the section of code that pertains to checking for a winner and summing all possible options for a winning row of four chips. It took several days to figure out that a zeros board was needed for each player to store their move and then sum the board to check for a sum of four either horizontally, vertically, or diagonally, in a row. To address these concerns and overcome the obstacles that came up, more directions were added to the program so that with each turn, the player is reminded of the rules. A section of for loops and if/else statements were added within the while loop to check for a winner using the zeros board established earlier in the program. This system is much easier to use rather than manually checking for every single possible winning combination.


Discussion for Black Jack game


Our game is actually not that complete since one of the developer is not familiar with the rule of the game and the game can’t bust out the player and dealer when the value of the cards on their hand exceed 21 and need the player to obey the rule to ensure that the player will not be handed with another card after the value exceed 21. There should be a while loop to make up this function. During the game development. Also, the game can’t allow player to keep playing after one round and the player has to enter the program again to keep playing. There should be a while loop that ensure the user will always been prompted and asked about whether they want to play again. During the development, to ensure that the player will not been interrupt by other information prompted from the matlab, efforts has been made to adjust the place of variable definition and rules and allow user to see the rules and the hands clearly. At first, the dealer will use ace to judge whether to add 10 up to its value and decide whether to get another card but the dealer can’t take off that 10 once it pick up another card and has total value exceed 21. A if -elseif loop is designed to let the dealer to recalculate its value when the total score exceed 21 and there are aces been considered as 11 in the game. We had struggled for IL for quite a long time and figure out there is a line lost from the program so we started to keep detailed comments with our code to ensure we will not miss lines again.