• Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing Blackjack  RSS feed

 
Saikrishnan Srivatsan
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am thinking of implementing blackjack. I have come up with the following set of rules:

1) Hand: Cards held by a player. For it to be a winning hand, must be greater than dealer hand or dealer must bust.
2) Dealer deals cards one by one to player(s) in clock-wise direction(for 2 rounds)
3) The dealer finally deals the face-up card to himself.
4) After looking at their hand players can 'stand'(ask dealer not to deal anymore cards) or 'hit'(deal one card everytime
the option is chosen).
5) 10 and 'A' is a blackjack hand, takes precedence over other 21 pt hands and hence a winning hand.
6) 'A' can take 1 or 11 based on the other cards in a hand. A player cannot bust if one of the cards is 'A'
out of the two initially dealt cards, when he goes for a hit.
7) A hand with 'A' and another card is a 'soft' hand. Otherwise it is called a 'hard' hand.
8) After all the player(s) have finished playing, the dealer deals cards for himself until his hand is >= 17(Only if he has a 'hard' hand)
9) After point 8, the 5 possible outcomes are:
  • Dealer hand less than Player hand.(Player win)
  • Dealer hand more then Player hand.(Dealer win)
  • Dealer hand busts.(Player win)
  • Player hand busts.(Dealer win)
  • Player hand and dealer hand are equal and they split the wagered amount


  • Please review and comment.

     
    fred rosenberger
    lowercase baba
    Bartender
    Posts: 12565
    49
    Chrome Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The rules of Casino Blackjack are well known. Your rules don't quite align with those - is that intentional?
     
    Saikrishnan Srivatsan
    Ranch Hand
    Posts: 58
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you, Fred. No, I just read the rules on-line and intended to write down the actual casino rules. But I am not sure if I should try to implement the whole game as played in a casino. Kindly let me know if there is a "subset" that I can start with.
     
    fred rosenberger
    lowercase baba
    Bartender
    Posts: 12565
    49
    Chrome Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Of course there is. If you are writing it, you can write it however you want.

    What you have IS a subset of casino rules (insurance, splitting, doubling down, and surrenders are all not mentioned by you).

    and technically, #7 is wrong. Any time an ace is counting as 11 it is a soft hand, regardless of the number of cards.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!