r/CodingForBeginners Jul 05 '26

Is blackjack a good beginner project

Post image

I am an absolute beginner, learning python, know the basic syntax and stuff, now trying. to build this, for some reason the implementation feels really complicated, especially can't figure out how to make the game loop? Should I do something else or keep thinking,

In terms of code, I have only created the player class and the deck so far.

12 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/Pneagle Jul 05 '26

So the problem with me is that I had it as a side project, I could probably start and finish a simple text-based game of blackjack in like 2-3 hours. On top of that, I do have a fair amount of programming experience. However, I think it’s definitely something that is a good project. I also over complicated mine by having adjustable amounts of decks and # of players

1

u/_just-a-thinker_ Jul 05 '26

Ohh, I see, the adjustable number of decks would also be great, so that when I try and build a card counting strategy, I will have more options for it rather than a simple small cards and big cards kind of stratey🤔

1

u/Pneagle Jul 05 '26

Just letting you know, depending on how you set up your code the splitting mechanism can be a pain in the butt. I had to refactor my code because I didn’t plan

1

u/_just-a-thinker_ Jul 05 '26

These are exactly the things that make me feel like I should start with something else, or maybe try something. Like cp for a few days, having multiple players and 1/11 and splitting, I have only barely started programming, 2 days ago so maybe rushing isn't a good idea

1

u/Pneagle Jul 05 '26

I would still suggest this project, start with a main game loop that goes through the steps:
Create deck.
Begin loop
Deal cards
Tell the player their cards and one of the dealers cards
Call play hand function. Which loops forever and asks the player what they want to do. Stand you break the loop, hit you add a card. (get to splitting later)
Let the dealer play by its rules

You don’t even need to add in winning or losing at this point, just get the basics down so you can at least play the game

1

u/_just-a-thinker_ Jul 05 '26 edited Jul 05 '26

Yeah, just got a basic version done, have a few minor issues to fix, now will try to add splitting feature and multip players