F. Discussion

 

Over-Under:

As previously stated our team created three different games, each of which being different in difficulty to create. Over-Under was the easiest to make due to the simple nature of the game and was done by one person within just a day. As a result, this game required little testing for it to work smoothly.

Hangman:

Hangman was the next game in order of difficulty. Initially, the progression of this game came about quickly as all that had to be done was to define variables and come up with topical puzzles for OSU students. After this initial stage, it took some time to figure out a way to change dashed lined into letters when a correct letter was guessed but after a little bit of simple testing a sensible solution was found. The major hold up in the completion of this game came when creating the while loop in order for the game to keep going after a letter was guessed. There were a lot of issues with either the game simply not continuing after a letter was guessed or not stopping when the puzzle had been solved. Often the reason for the infinite loop/lack of loop was not clear and problem-solving was very much 1 step forward 2 steps back. Sometimes a probable solution would work up to a certain part of the puzzle then fall apart. Solving this issue ultimately came from a lot of trial and error and simply seeing what kind of things worked and seeing how they could be adapted into the code in a sensible way if it all. This is because certain lines of code worked well in isolation but when put into a larger project certain thing would interfere and simply were not viable solutions.

Blackjack:

Blackjack was the most complex game created out of the three. The progression of development of this game went fairly quickly in consideration with the complexity of the game. Most of the utility functions were the first to be programmed with the code that was used to test these function eventually turning into the code for the play function. One utility function that proved to be the most difficult to implement was the function to calculate the player’s score. Initially, the function calculated the score of the entire player’s hand by looping through their hand matrix that contained the number and suit of their cards. The largest problem with this way of calculating the score was that when the player hit to draw a new card, the score of their entire hand would have to be recalculated with the new card and if they had and ace in their hand that they already chose the value for, the function would ask the player what value they would like the ace to be again and so they would have to input their choice each time allowing for a change in this value which is prohibited in real blackjack. This method was also very inefficient as the entire score would have to be recalculated for each new card added into the player’s hand even though the score excluding the new card was the same as before. The score calculation function was subsequently redesigned due to these error and inefficiencies. The new design for the function calculated the score for only one card and returned the score for that single card. The score output by this function was then added to a score keeping variable. This new design solved both the error with the ace value reassignment and the inefficiency of calculating the score. Because the calculate score function only returned the score for a single card, the player’s total score was tracked in the play function. Each time a new card was drawn, its score was calculated then added to a player score variable instead of recalculating the score of the entire hand within the calculate score function which decreased the repetition of score calculation and increased efficiency. The ace value reassignment error was solved by this redesign because once the player chose a value for their ace, it would be added to the score variable and would not need to be recalculated if a new card was added to the hand. Development of the other utility functions, the draw card function and the display card functions a well as the play function, went fairly smoothly with no major errors.