How to Program Console Blackjack in Java
I'm new to programming and I'm joining here to ask questions, contribute when I have more knowledge under my beltand basically just learn and figure out if programming is right for me.
I am currently learning Python through a course on Udemy and Blackjack programming tutorials working on a milestone project to create a Blackjack game.
The only rule is for me to use Object Oriented Programming and to blackjack programming tutorials classes for things like the Card and Deck.
I've watched some tutorials on OOP, but I still do not feel confident in implementing them, so I was hoping I could share what I've written and hopefully have a better understanding through interactions here.
To start, I created a plan to break the project down into smaller tasks as it was overwhelming to blackjack programming tutorials />I'm basically trying to create a list with all 52 cards in it using OOP and for loops, but I can't seem to get things right.
I'm sharing my code below which was written in Python 2.
Any ideas how to proceed?
Thank you, Paul Edit 1: Thank you everyone for the comments and feedback.
I think I am getting a little closer now.
Can someone please let me know if I am doing this right and how I can print the list I used to create my deck such that I am able to see each of the 52 cards in a list?
I tried using the read more method but it appears I'm doing it wrongly.
That said, I'll give you a couple pointers.
You've got suit and link arrays defined outside of any class also you've got their names flipped, but whatever.
I would put those inside the Deck class, since that's where they're used.
Think of it this way: each Card doesn't need to know all the possible blackjack programming tutorials and suits, it just needs to know its own rank and suit when it's created by the deck it belongs to.
I'm not sure what's going on with self.
What are you trying to do there?
In the next line you've got self.
That sounds ok, however, it's not a good idea to name a local variable the same as the name of the class it belongs to.
That's going to get confusing.
I would suggest calling it cards, because it's going to be an array full of cards that belong to the deck.
Your loops look ok, but right here: self.
The card needs to know what rank and suit you want to assign to that particular card.
I'll let you look into how to do that yourself.
Good luck : Eh, I don't really agree that using module-level constants to contain suits and ranks is "not OOP".
Normally, anyway, you would use enums to represent "suit" and "rank" as they are sort of a.
That isn't source necessary for this assignment, where global lists holding suit and rank info seems fine.
Say you wanted to add a Tarot Card Deck, and reuse your Card object.
Good call on array vs list, I've been writing more JS than Python lately!
My main point is that module-level constants are ok, as long as they are actually being used as constants.
And Blackjack programming tutorials would probably just use enums in this case anyway, like I show in that linke where I implement a Click here and Deck class.
I would just have a TarotSuit cash prizes blackjack free as well.
Provide details and share your research!
To learn more, see our.
Third checkpoint in the Blackjack game development cycle, now with more polish! Woohoo! Have fun :D...
I consider, what is it very interesting theme. I suggest all to take part in discussion more actively.
Look at me!
I consider, that you commit an error. Let's discuss. Write to me in PM.
You commit an error. Let's discuss.
And you so tried?
I apologise, but it not absolutely approaches me.
Completely I share your opinion. In it something is also idea excellent, agree with you.
I confirm. It was and with me. We can communicate on this theme. Here or in PM.
I apologise, but, in my opinion, you commit an error. Let's discuss it. Write to me in PM, we will communicate.
The excellent message gallantly)))
In my opinion you are not right. I am assured. Write to me in PM.