• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Implementing Blackjack

 
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

     
    lowercase baba
    Posts: 13002
    66
    Chrome Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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: 67
    1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 13002
    66
    Chrome Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
    reply
      Bookmark Topic Watch Topic
    • New Topic