Peer Review of Aaron's Blackjack Game

by Samuel Robinson

08 Jun 2017

Aaron’s blackjack game does a good job of meeting the basic and advanced requirements for this assignment, and adds a few extra features. It starts by telling you which two cards you have in your hand, and their total value. You then can get another card, or pass to see the dealer’s cards. The game will compute for you whether you or the dealer has gone over 21, whether one of you has gotten a five card charlie, and who has won overall. The game also ends each round by telling you your current win/loss percentage and asking if you would like to play again. If I were to change one thing about the gameplay, it would be to improve the two text input controls in the program. As is, when the game asks if you want a new card or not, it records anything entered other than the string ‘n’ as a yes, and will deal you a new card. Conversely, when it asks if you want to play again, it counts anything except the string ‘y’ as a no, and ends the game. This could be streamlined by putting the input requests into short while loops, which won’t move forward until the user inputs something they recognize. This would stop errant keystrokes or typos from changing what you want to do in the program. Other than that though, this is a great, streamlined game of blackjack. The inclusion of a win/loss percentage is also a great feature, as it incentivizes repeat play. Aaron even mentions this in his reflection, and how he added a lot of dashes around the win percentage in the text box, to accent it visually, and help push people to keep playing, to get a better percentage. My favorite part of Aaron’s program, however, is his wonderfully organized code. The entire program is broken down into five different modules, each of which mainly consists of concise sets of interconnected functions, which handle all of the game’s systems. Each of the modules frequently references functions in other modules, and they all work together to what appears to be a seamless, efficient machine. Also, every function and every relevant sub part of each function is meticulously commented, to better explain exactly what each part does and why. I personally want to study what he did and how in this program, in order to improve my own coding. I can make a lot of things work in python, but I feel like a lot of my code is pretty chunky, and uses a lot of brute-force solutions. I think I could learn a lot from Aaron’s much more streamlined modules, and especially from his nested functions. Aaron’s reflection and milestones match up very nicely with the sections of his code, further showing how he laid out the main bullet points of what he wanted to do for this project, and then completed them in an organized and streamlined way. His milestones also do show a couple of further goals he wanted to reach for but couldn’t, such as implementing betting, and changing how much the player can see of the dealer’s opening hand.

Sam Robinson is a second-year MSLS student at UNC Chapel Hill's School of Information and Library Science. Find Samuel Robinson on Twitter, Github, and on the web.