Algorithm / Flowchart

BLACKJACK

  1. User insert number of players.
    1. If player number is less than one or a non integer, go back to step 1.
    2. If input is greater than or equal to one, go to step 2.
  2. Ask for bet from each player.
  3. Assign cards value
    1. If card is 2-9, card’s value is that card number.
    2. If card is 10, Jack, Queen King, card value is 10.
    3. If card is Ace, player determines whether value is 1 or 11.
  4. Give each player random card
    1. If card is Ace, player determines whether value is 1 or 11.
    2. Give each player one more card.
  5. Assign each user with a value totaling the value in their deck.
  6. Check value of each player’s deck.
    1. If player has deck == 21, player wins. 
    2. If all under 21 go to next step
  7. If any players have two of the same card in their deck, ask if they want to split
    1. If yes, that player splits cards into two hands they are given two random cards.
    2. Go to step 6
  8. Ask each player hit, stand, or double down
    1. If hit, give them a card 
      1. If at 21, player wins
    2. If stand, no card
    3. If double down, double bet and draw one card
      1. If at 21, player wins
    4. If anyone hit and are under 21, ask if they want to hit again.
  9. Is anyone over 21?
    1. If yes, that player loses
    2. If no, go to step 10
  10. Dealers second card is flipped and evaluated
    1. If under 16, dealer hits until he gets a value => 17
    2. If the dealer busts, everyone not over 21 wins their money back 100%
    3. If you got a blackjack and the dealer doesn’t, it’s a push. Player gets money back.
    4. If the player and the dealer gets a  black jack, they get no money back.

CONNECT 4

SDP_TeamA_Connect4