DEV Community

ShaneFalero
ShaneFalero

Posted on

First python project.

First time post. Getting into software development. Started learning Python in June and plan to expand my knowledge base of other languages as well over the next several months via codecademy.
First portfolio project that I have created.
Within this project, I have developed a mostly functional blackjack game (need to incorporate splits still; back to the drawing board).
Within this program; a card class of each card has been made referring to the card itself and its point value (the point value was placed to be utilized in other games, but does not have to be accessed). A player class has been created that will be iterated through at the beginning of the game for each player that wishes to join the game. A dealer class was created to give the dealer some form of definition as the game goes on. The dealer class and the player class have a set amount of money at the start of the program.
Within the dealer and player classes, several methods were developed to establish a point count of the cards for each individual, a hand list for each individual, some decision making for both the deal and the player, and an ante system for the player as well.
After the classes have been created, I created helper functions to help determine which individual won the round and who lost, by appending individuals to specific lists based on outcome; money was divided based who was in which list. (I think I went a little crazy with the returns for blackjacks).
After the winners were decided, the cards were placed back in the deck and removed from the hands of the players and dealer and the lists were emptied.
I really enjoyed this project as it helped me think of different ways manipulate data. I also learned that boolean attributes of class are immutable (would've helped at the beginning, as that is what alot of my initial logic entailed manipulating; self.win could not be switched to True). I definitely understand that I need to work on utilizing less code to make my coding more clean, but I feel that it will come with experience.

https://github.com/ShaneFalero/Portfolio-projects.git
I look forward to some form of feedback.

Thank you,
Shane

Top comments (0)