Your main game loop should ask the user how many players, and allow .docx - Your main game loop should ask the user how many players and allow that many

Your main game loop should ask the user how many players, and allow .docx

This preview shows page 1 - 4 out of 15 pages.

Image of page 1
Your main game loop should ask the user how many players, and allow that many players to play the game. You may assume a max of 6 players. You should allow your players to wager some amount of money on each play. You need to take in user input! I assume this means that you should not automate your game. You should make it so that 1-6 real people could use your program to play your game on 1 computer. Your program follows all of the rules of blackjack specified in the assignment: Each round of simplified blackjack proceeds as follows: The dealer shuffles the deck and deals two cards "face up" (with the front of the card showing) to each player. The dealer deals one card "face down" (with only the back showing) and one card "face up" to himself. The dealer asks the first player whether she wishes to "hit" (receive another card) or "stand" (not receive any more cards). If she chooses to stand, she will not receive any more cards this round, so her score is fixed. The game moves on to the next player. If she chooses to hit, the dealer will deal her another card, face up, and her score increases. She will then be given the option to hit or stand again. If her score exceeds 21, she has "busted" and immediately loses this round - play will continue with the next player. Essentially, the player can continue to hit until she either
Image of page 2
decides to stand, or busts. The hit-or-stand process is then repeated for each other player. Once all players are done, it is the dealer's turn to play. First, he turns his face-down card over. Then he hits until his score is 17 or higher. The dealer cannot decide to hit or stand arbitrarily. If his score is less than 17, he must hit. If it is 17 or higher, he must stand. If the dealer busts, any players who did not bust earlier win this round. Otherwise, each player's score is compared to that of the dealer. A player wins if he has a higher score than the dealer, loses if he has a lower score, and "pushes" (ties) if he has the same score. At the end of each round, the group of players can decide whether they would like to play again. Make sure everything that is calculated works properly! Here are the guidelines for results of a round: Each hand will result in one of the following events for the player: Lose - the player's bet is taken by the dealer.
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 15 pages?

  • Fall '19
  • Playing card, player

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture