Amandas blackjack

by Amanda Baker

07 Jun 2017

Below is my trinket link!

<iframe src=”https://trinket.io/embed/python3/28d038d3a6” width=”100%” height=”600” frameborder=”0” marginwidth=”0” marginheight=”0”

I MUST ADMIT, WHEN THIS ASSIGNMENT WAS GIVEN, I WAS SUPER EXCITED AND MY MIND STARTED WHIRLING WITH ideas. I thought to include robots, alternate games, implement the deck of cards and other fine-tuning ideas. However, I never imagined when I sat down to write the code I would be completely blank of mind in where to begin. Normally, something like a paper, in my head, I have an idea of the beginning, middle and end. I thought the same would happen with this program. I was wrong. Once I had no idea where to start, I started commenting out ideas. For example, I knew I needed a function for the deck of cards, for the user, dealer, game and win conditions. So, I started there. I worked with tuns and tuns of code, going through errors, trying to solve global variable issues and more. I tried to figure out how I could implement if true statements and got really lost. Alter I left the code clinic, I took a break. Put down the code and stepped away for about two hours. After that, I decided to open a notepad file and started again just thinking of innovative ideas. Suddenly, a much more comprehensive code stated being written. I was really surprised and I am worried it is something I would not be able to do again. I feel like my code process and ways I think is a lot more like the first code I did which was very wordy, not very concrete and could run a lot of errors. I am really disappointed I was unable to implement my milestones but I started coding for some of them and I hope that this means I am in the right direction for coding. Even if I cannot get the full code, I am thinking ahead, thinking of what I want in my code, thinking of my next steps. I just wish I really understood a lot of the basics more. Something I realized while doing this project is I have a large python vocabulary, but I have no idea how to implement it. I feel like I can regurgitate different methods without fully understanding what they do or how to use them. To correct this, other than coding more, I think it would take rereading the chapters now that I understand them. The more I read through explanations, look at simple code using those methods and then trying to implement them in future projects. The concern is that there is not enough time. Since this course is so short, there is about two weeks left. I have no idea if it would be enough time to really grasp everything.

Milestone (Included lots of basic and some advanced) • Create function that can make the “deck” of cards • Create function for user and dealer • If I can get the blackjack to work, create function for a robot to play. This robot will have a name list = [names] which will be randomly chosen by random.choice to be another participant • Haven’t decided if I will do something like the dealer where it is a random number between something like 15 and 21 or create a function such as if the two cards drawn is less than 15, give the robot another card. • If the program is running well, try to create a deck. I understand I will need to create suits, numbers 1-10 for 40 cards and jack, queen and king will be worth 10. I don’t understand how to really tackle that though, and I was hoping for more time to figure that out. • Also wanted to try to incorporate a split hand • For the basic program: get scores to sum and win statements to print

Amanda is a Masters student at UNC studying Information Science. Outside of class, Amana is an avid reader, loves music, and loves outdoor sports. Find Amanda Baker on Twitter, Github, and on the web.