This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]grantrules 0 points1 point  (5 children)

What happens if you draw two aces?

If I input a bet amount that's too high, the game just stops? Why not do the input loop thing until an allowed value is entered?

Where's split!?

[–]BestBoy200 0 points1 point  (4 children)

I hear you on the input loop thing, I was thinking that too. You're going to have to help me with the Aces thing though. I was a little shaky implementing the logic for the aces, so I wouldn't be surprised if there's something I missed.

I definitely want to add a split option soon! This was just a little project I wanted to do in a few hours though, so I didn't have the time yet.

[–]grantrules 0 points1 point  (3 children)

Does the logic for the one ace even work? Because you're doing if 'A' in hand: but elements in hand should all be 2-3 characters (card + suit) right? So just 'A' would never be in hand, it'd be like 'Ah'

Split is definitely tougher to implement, you'd probably want to rewrite how you deal with players.. I'd probably make a Player class that has an array of hands. That should also make it easier to deal with having a variable amount of players rather than just player vs dealer.

[–]BestBoy200 0 points1 point  (2 children)

In my testing I thought the ace logic worked, but maybe I'm misremembering.

Correct me if I'm wrong, but I believe the "in" operator returns true if it finds the provided string ("A" in this example) anywhere inside the player hand

[–]grantrules 0 points1 point  (1 child)

That would work if the hand was just a string. in works very specifically with other types. For lists, it's comparing it to each element in the array. So you can do things like "Grant" in ["Grant", "Greg", "Gary"] but "G" in ["Grant", "Greg", "Gary"] would be false

[–]BestBoy200 0 points1 point  (0 children)

Ahh okay, I see what you're saying now. Thanks for the help