Shuffle A Deck Of Cards Python

What you will make. Tienes que intentar tener más puntos que el otro, sin pasarse de 21. #-----# deal. The shuffles will be biased, that is, such that the card taken to the top is in general not chosen uniformly at random from all the. append(card1) if card1 in deck: deck. c++,templates,constructor,explicit-instantiation. to-top shuffles, that is, card shuffling chains where every transition is such that some card is moved from its present position to the top of the deck without affecting the relative positions of the other cards. This question is also asked as “shuffle a deck of cards” or “randomize a given array”. Apr 05, 2014 · There are more ways to arrange a deck of cards than atoms on Earth $ python cards. PyDealer is a simple to use Python package for “simulating” decks of standard playing cards (also known as a French deck). In fact, I contend that this supposedly defective algorithm is in fact unbiased and equivalent to the Knuth shuffle. You'll start with simple projects, like a factoring program and a quadratic-equation solver, and then create more complex projects once you've gotten the hang of things. Nov 25, 2019 · In general, in-shuffling a deck of cards once moves card to the position originally occupied by the th card (mod ) (Conway and Guy 1996). Once a deck of cards is divided to each hand, the amount of cards in each hand is not (likely) equal. Nov 01, 2018 · We would like to draw a card from our shuffled deck. You can vote up the examples you like or vote down the ones you don't like. Here's the best way to shuffle a pack of cards - with a little help from some maths February 22, 2017 11. (b) Find P(J) and P(R). In most situations, the card's effect will be insignificant, however in some games, especially against long-game control decks or fatigue style decks, its effect can almost guarantee a victory if the game reaches fatigue. asList(a)) to shuffle the entries in an array. A standard deck of playing cards has four suits (Hearts, Diamonds, Spades and Clubs) and thirteen values (2 through 10, Jack, Queen, King and Ace) which makes a total of 52 cards per deck. I want something I can generate now and use over the weeks to come. a guest Oct 26th, 2016 56 Never Not a member of Pastebin yet? from random import shuffle. So just what is a "perfect shuffle"? It means that given 52 cards in a deck, you manage to break the deck exactly in half so that there are 26 cards in each half. cardsLeft(self) - Returns the number of cards left in the deck. CODE ON YOUR MOBILE. Shuffling a deck of cards Often times we are interested in randomizing the order of a set of items. Draw two cards. Therefore, in-shuffling an even number of cards times when is prime results in the original card order. The program above does that for us. Python Flash Cards take a tried-and-tested method and give it a programming makeover. For example, if you are observing the cards carefully at the blackjack table (and the dealer has enough decks randomly shuffled together), you will wait until about 235 cards are dealt, on average, before seeing every card value. The outshuffle is the one I wrote in my comment above. So, at this point we'll just have a Deck of Cards that are neatly in order. On the left, shuffle is like actually shuffling the deck. Bozo sort If the list is not in order, it picks two items at random and swaps them, then checks to see if the list is sorted. What does shuffle the cards expression mean? Definitions by the largest Idiom Dictionary. I'm tossing up between instantiating each card and assign a value to them at the begining of the game, then just finding the top most card in the deck to deal. Create Deck. One of my. Predictable behaviours that make a human shuffle imperfect. This question is also asked as "shuffle a deck of cards" or "randomize a given array". And: This is true because it performs all the operations together, rather than one after another. Once the length of the testdeck is 0 the self. If you want to know how to shuffle a deck of playing cards like a professional, just follow these easy steps. Shuffle tracking is a nontraditional blackjack strategy technique that you might not often hear about it. Both are made up of a set of cards, and both require operations like adding and removing cards. The deck is represented as a list of cards. Bozo sort If the list is not in order, it picks two items at random and swaps them, then checks to see if the list is sorted. Case studies 3. This is a really small deck with only 4 cards in it. For a full list of python modules, see the online documentation listing all of the default. In particular, we employ shuffle, which takes any list and returns it in random order, to shuffle our deck of cards. For now I'm looking to just get my class working, so don't worry about the program that'll use the class as of yet. a new deck of cards), or else with cards in an order representative of a specific card game. py For examples of how to use these in a program, see the main() function at the bottom of the program. Random functions The Random module contains some very useful functions Randint. Oct 29, 2016 · I am having trouble removing the same cards from my hand in my game of oldMaid. As each thumb releases from it's half of the deck, sometimes more than one card drops from a single hand at a time. 6 from Think Python. Jan 14, 2017 · Shuffling a deck of cards (using Lists) in Python Python script to shuffle a deck of cards using lists. Also feel free to improve it. Finally, play() plays the game. """ Simple card game by Mr. ) • Steps to initialize and print out the properties of each component Imagine you want to simulate something:. Gambling can be fun and harmless, if you expect to lose. Essentially what you'd have is an encryption algorithm that takes in a value 0 to 51, and a key (shuffle seed) and spits out a value 0 to 51. In this tutorial, learn how to use an ordinary deck of cards and make them into a safe for your personal belongings. Enlarge the cards to fit the screen or shrink them for a mobile device. It will not cause strange biases in your code. In a casino, we can see cards handled in a number of different kinds of collections. shuffle the cards phrase. #-----# deal. shuffle(); // shuffle the cards in the deck deckOfCards. Create a Deck. Perhaps a better definition would have used language like " begins with 52 cards" or the like, and described the properties of a deck to be modelled. You can use ArrayLists, collections, shuffle or even use Math. The itertools module generates every possibility of the range of cards for Spade, Diamond, Heart, and Club. Python program converts decimal number to binary number using recursion. We will have three classes. Las reglas son sencillas: las cartas J,Q y K valen diez puntos, los ases 10 o 1, y el resto por su número de carta. Deck of Cards. If such a generator is used to shuffle a deck of 52 playing cards, it can only ever produce a very small fraction of the 52! ≈ 2 225. So, at this point we'll just have a Deck of Cards that are neatly in order. Why Card Counting Works. Learn About Coding with These Ultra Nerdy Playing Cards. How would you write code to shuffle a deck of cards? I was thinking about this after reading Mike's card-shuffling algorithm woes: Here's where the non-CS mind comes into play. How to create a deck of cards. This means that an ordinary deck of 52 cards is returned to its original order after 52 in-shuffles. Create a model of a deck of cards that can form the basis for building digital card game programs such as Poker or Gin Rummy. While seemingly simple-- shuffling a deck is a somewhat complicated problem. This chapter is taken from the book A Primer on Scientific Programming with Python by H. I am trying to write a code for a project that lists the contents of a deck of cards, asks how much times the person wants to shuffle the deck, and then shuffles them. Replace the drawn cards back into the deck and repeat this sampling procedure a total of at least thirty times. But if you plan to make something connected to real Money - like online poker/blackjack platform - It's better to make it impossible for potential hackers to "see" the shuffled array. A card is a tuple containing a number between 1 and 13 representing the cards value and a string contianing. These are pseudo-random number as the sequence of number generated depends on the seed. Python Forums on Bytes. Finding the shufflyness of a full deck of 52 cards is really exactly the same as what I showed above for the 8-card deck, with the obvious difference that the 52 card deck has more cards. Write the hands to standard # output. HOW MANY TIMES SHOULD YOU SHUFFLE A DECK OF CARDS? 1 Brad Mann Department of Mathematics Harvard University ABSTRACT In this paper a mathematical model of card shu†ing is constructed, and used to determine how much shu†ing is necessary to randomize a deck of cards. * * This class implements the Fisher-Yates shuffle * as a static method. Then cards are dropped from the two stacks according to the number of cards remaining in each stack. Python offers random module that can generate random numbers. Deal 5-card # hands at random to playerCount players. Im relatively new to python therefore if anyone can give me a hint in the right direction that would be great thanks. Apr 01, 2015 · Let’s build a deck of cards based on the stack abstraction. I lamented at the end of the post that the algorithm is not easily vectorized. Test your card class with a program that prints out n randomly generated cards and the associated Blackjack value where n is a number supplied by the user. A complete Python guide to Natural Language Processing to build spam filters, topic classifiers, and sentiment analyzers. A hand is also different from a deck. Considerations. Card Game Simulation. Gambling can be fun and harmless, if you expect to lose. In theory, it would make sense to make a request that would draw one or two cards each time a player in the game clicks a button to draw a card. The shuffles will be biased, that is, such that the card taken to the top is in general not chosen uniformly at random from all the. I will be teaching you how to do a hindu shuffle, an overhand shuffle, and a riffle shuffle. Thus the ace of spaces would look like (1, "spades") and the king of diamonds (13, "diamonds") A deck is a list of 13 cards. Python offers random module that can generate random numbers. Apr 12, 2012 · Python: How to remove, or pop an element randomly from a list since you have to shuffle your whole deck and then pick 1 card at a time. You need to write a simple set of functions to handle cards in a deck. Jul 24, 2015 · Blackjack Shuffle Tracking How Shuffle Tracking Works in Black Jack. So, altogether we have 13 * 4 = 52 items in the deck with each card as a tuple. a new deck of cards), or else with cards in an order representative of a specific card game. The constructor for this class should fill the ArrayList with 52 Card objects (the deck may start with the cards in any order; use nested loops to simplify the Card-creation process). shuffle(x[, random]) Shuffle the sequence x in place. It has to use a method to create…. If we shuffle a deck thoroughly and deal out a four card hand, there are over 300,000 different hands. Write the hands to standard # output. Your program should create a deck of cards, shuffle it, and then put the first five cards in the deck into a 5 element list which represents a hand. This program can be done in multiple ways. Thus the ace of spaces would look like (1, "spades") and the king of diamonds (13, "diamonds") A deck is a list of 13 cards. A card is a tuple containing a number between 1 and 13 representing the cards value and a string contianing. class Point: def __init__ (self, x=0, y=0): self. Combined with effects such as Amara, Warden of Hope or Reno Jackson, immense amounts of time can be added to. *; import java. Nov 08, 2009 · I'm trying to write a class of a deck which will create an ArrayList of 52 playing cards and returns them either in order or shuffled. Then the counter constantly adds and subtracts from the count, according to the cards played. For example, the last line of our single-item selection would be:. In this quick tutorial we'll show you how to create a card object and a deck object and then we'll show you how to shuffle the deck of cards. Sep 17, 2014 · Deck of Cards Workout. Practice with linked lists and pointers. This constitutes one shuffle of the deck back to the second deck. Shuffle tracking is a derivative of card counting but you usually won't find much information on the subject. For instance, if the 5th card you draw happens to be a 5, it's a coincidence. GET THE APP. Its 80% done Write a program to shuffle a deck of. shuffle() method can be used to randomize the cards in the deck. Also note that online casinos shuffle the deck after each deal, so it is impossible to count cards when playing blackjack online. Extract 10 Cards. Once a deck of cards is divided to each hand, the amount of cards in each hand is not (likely) equal. The deck should act like the real thing, so it makes sense to define a generator that yields cards one at a time and becomes exhausted once all the cards are dealt. Each character records the supporters they rally, the supporters they uncheck, and the supporter feats they gain on their own Chronicle sheets. import random from Card import Card class Deck: def _init_(self, card, num): self. Python's random. Okay, so now it becomes a little more obvious that there are three different types here. We shuffle the deck of cards by swapping each card at random with the cards that occur after its position in the given array using Math. In modelling shuffling of an n-card deck, the state of the deck is represented as a permutation m E S,,, meaning that the card originally at position i is now at position m(i). 8: Random numbers and simple games. Transcribe this deal to make your input card list file. 6 possible permutations. Shuffling a deck of cards does not return any value (It only has effect of the state of the cards in the deck ) Therefore : the method shuffle return a void type. Python Forums on Bytes. By that I mean a game that uses a regular 52 card deck. TaggedDocument(). shuffle(); // shuffle the cards in the deck deckOfCards. Source code for python_card_game. The pair 7 and 8 is not separated until the fourth shuffle. Algumas vezes, queremos que o gerador de número reproduza a sequência de números criada uma vez. Write the hands to standard # output. But when a dealer gives you a card, they just take it off the top of the deck, they don't fish through the deck to get a random card. org/wiki/Shuffling#Riffle. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs. Each tuple have suit and rank ('♠', 'A'). Shuffle this deck and draw cards one by one. Use magic numbers. Shuffling a deck of cards Often times we are interested in randomizing the order of a set of items. A perfect shuffle divides the deck exacly in half, and then interleaves the two halves in strict alternation. Perfect Shuffle. Hi there, I have a really quick question about a shuffling and dealing cards program I found in a book. The second method (shuffle_v2) assumes that if i-1 cards are shuffled well, try to randomly swap card i with any card from 0 to i-1. You need to write a simple set of functions to handle cards in a deck. 27: fig08_27. shuffle() method can be used to randomize the cards in the deck. 10 Ways to Teach Computing Using a Deck of Cards Compiled by Jessica Dickinson Goodman, Susan H. With human beings this is a bit of a random event, you never know how the deck is going to turn out, but with a computer we can shuffle the cards perfectly every time. There are 54!, or about 2. 1 Exercise 18. The program should display each card in the command window and explain what is done with the card. Las reglas son sencillas: las cartas J,Q y K valen diez puntos, los ases 10 o 1, y el resto por su número de carta. Also, we might like the ability to shuffle both decks and hands. Extract 10 Cards. Write the hands to standard # output. Just remember that Deck. find_list (and Stack. Algumas vezes, queremos que o gerador de número reproduza a sequência de números criada uma vez. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs. We shuffle the deck of cards by swapping each card at random with the cards that occur after its position in the given array using Math. Apr 14, 2012 · Converting from python to C++ help. - DYZ Jun 8 '18 at 23:58. 2 days ago · download index card rpg core pdf free and unlimited. Participants will be exposed to essential data structures like lists, dictionaries, and tuples to store collections of related data. Then I'd create a second array-like structure. Apr 14, 2012 · Converting from python to C++ help. py from chapter 9 of Michael Dawson, "Python: Programming for the Absolute Beginner," Third Edition, Course Technology PTR, 2010, Cengage Learning, Boston, ISBN 978-1-4354-5500-9, to avoid problems when run under Python 2. You can use Programmer Playing Cards to play all the classic games people play with cards — Poker, Blackjack, Solitaire, and even those late night drinking games (with shots of Tabasco sauce, of course). Welcome to Part 2 of the Python Blackjack Game Tutorial series. So 2,704 — 52 = 2,652. There is an overflow of text data online nowadays. The Card class should have a suit (Hearts, Diamonds, Clubs, Spades) and a value (A,2,3,4,5,6,7,8,9,10,J,Q,K). Wilson The player and computer each draw a card from a shuffled deck. An out-shuffle is, after all, equivalent to an in-shuffle on two fewer cards. In this tutorial, learn how to use an ordinary deck of cards and make them into a safe for your personal belongings. For our purposes up to 20% of the deck seems like a good amount. The whole point of shuffling a deck of cards is to randomize the order of them as best you can. We will write the deck with the order of the cards going from left to right, so that a virgin unshu†ed deck would be written 123¢¢¢n. The next step requires looping through the ranks and suits. Next is the same as dealing the next card. I have the card, which I think we've discussed, and then I have a hand and a deck, both of which are collections of cards, but both of which have different behaviors. The class Deck() makes use of the class Card(), the file for which needs to be located in the same directory as deck. deck is a local variable in the function create. This function performs the Cartesian product of the two sequences. I was idly shuffling a deck of cards when the possibility occurred to me of the "perfect" shuffle. Each of the shuffles starts with either fully ordered decks (i. - Create cards in a simple textual form - Use the random module to shuffle the deck - Advance to using OOP classes We want to build our own game of playing cards. arange(52), and we can shuffle by doing np. random() function. Feel free to read the documentation, but we have provided a simple wrapper function that will return to you a shuffled deck of cards. Bozo sort If the list is not in order, it picks two items at random and swaps them, then checks to see if the list is sorted. This form allows you to draw playing cards from randomly shuffled decks. Once a deck of cards is divided to each hand, the amount of cards in each hand is not (likely) equal. 6 possible permutations. asList(a)) to shuffle the entries in an array. GET THE APP. Mar 25, 2016 · The Best (and Worst) Ways to Shuffle Cards - Numberphile - Duration: 9:22. I would like to make a function that takes a list, more specificaly a list of strings, and shuffles its elements, like a pile of cards. With 52 cards an ideal structure would have 6 levels (log 2 (52) ~= 6), though if you dig into the skip lists even that could be reduced to a smaller number. The top half of the deck is placed in the left hand, and cards are then alternatively interleaved from the left and right hands (an in-shuffle) or from the right and left hands (an out-shuffle). In line 24-26, rank is looped first, choosing its first element. Nov 27, 2013 · Assignment 8. Find images of Card Deck. The constructor for this class should fill the ArrayList with 52 Card objects (the deck may start with the cards in any order; use nested loops to simplify the Card-creation process). shuffle the cards phrase. EXAMPLE 2: Given the choice of pets is ('dog', 'cat', 'turtle') choice(pet) randomly selects one of the pets; e. Extract 10 Cards. h" // DeckOfCards class definition int main() { DeckOfCards deckOfCards; // create DeckOfCards object deckOfCards. During This Adventure: When choosing deck upgrades, treat Harrow blessings that match the adventure's harrow suit as being level #. So you get a random number from [1. We will write the deck with the order of the cards going from left to right, so that a virgin unshu†ed deck would be written 123¢¢¢n. Deck method). The Efficiency of the GSR Algorithm. You can also use shuffle to sample from a two column matrix that has integer multiplicities in the rst column, and values in the second column. The Deck class should have a deal method to deal a single card from the deck After a card is dealt, it is removed from the deck. In theory, it would make sense to make a request that would draw one or two cards each time a player in the game clicks a button to draw a card. The random module is another library of functions that can extend the basic features of python. I am not allowed to use the built in python function to shuffle the deck of cards. HOW MANY TIMES SHOULD YOU SHUFFLE A DECK OF CARDS? 1 Brad Mann Department of Mathematics Harvard University ABSTRACT In this paper a mathematical model of card shu†ing is constructed, and used to determine how much shu†ing is necessary to randomize a deck of cards. PyDealer is a simple to use Python package for "simulating" decks of standard playing cards (also known as a French deck). Finding the shufflyness of a full deck of 52 cards is really exactly the same as what I showed above for the 8-card deck, with the obvious difference that the 52 card deck has more cards. A Sequential Collection: A Deck of Cards A Sorted Collection: Hand Implementing the Deck Class Concrete Representation Attributes: A Python list, cards, of Card objects, as de ned in Chapter 2. I recommend not to "shuffle the cards" but pick them randomly from an array initialized with all "Cards". Let the given array be arr[]. #-----# deal. If you want to know how to shuffle a deck of playing cards like a professional, just follow these easy steps. Sep 17, 2014 · Deck of Cards Workout. h" // DeckOfCards class definition int main() { DeckOfCards deckOfCards; // create DeckOfCards object deckOfCards. Cards are mixed, but not shuffled fully. It's easier to accomplish than it looks, and if you put in some practice, you can make it fancier by. Appendix C Complete Python Listings Point class. Eric Matthes, author of the best-selling Python Crash Course, distills essential Python programming knowledge into this 75-card deck you can use anywhere. Use magic numbers. Once you have implemented the Deck class, test your Deck class using the provided testing template. Nov 17, 2019 · However, if you want to test your knowledge based on a predefined list of words, it would be convenient to generate a deck automatically. 1 Exercise 18. HINT: you will need to repeat this ArrayList-filling process later for your shuffle () method. Finding the shufflyness of a full deck of 52 cards is really exactly the same as what I showed above for the 8-card deck, with the obvious difference that the 52 card deck has more cards. Another way to say the same thing is that if we put the cards back, shuffle and deal again,. Or have a deck object that instantiated the cards as you needed them. Magic numbers are unnamed numerical constants that appear in the code. Your program should create a deck of cards, shuffle it, and then put the first five cards in the deck into a 5 element list which represents a hand. Hi there, I have a really quick question about a shuffling and dealing cards program I found in a book. Using choice() could result in the same card being dealt twice, so instead, the deck can be mixed up with shuffle() and then individual cards removed as they are dealt. org/wiki/Shuffling#Riffle. You can rate examples to help us improve the quality of examples. I've been delaying my dive into Python 3 (because I don't need it for now) but I'd like to run some code just to learn how different it is from Python 2 and even other Python flavors. deck[0] = (1, 'Spade'). Cards are mixed, but not shuffled fully. - DYZ Jun 8 '18 at 23:58. In most situations, the card's effect will be insignificant, however in some games, especially against long-game control decks or fatigue style decks, its effect can almost guarantee a victory if the game reaches fatigue. random () function returns a floating-point number between the range [0,1) , where 0 (inclusive) and 1 (exclusive). I added the small feature of displaying your updated hand total after hitting. # Methods below are used to create and shuffle a deck. ## SHUFFLING A DECK OF CARDS ## A deck of cards has 13 cards each of 4 suits: heart(♥), spade(♠), diamond(♦), club(♣). Aug 13, 2019 · 4-Deck to 8-Deck Blackjack Strategy Introduction To use the basic strategy, look up your hand along the left vertical edge and the dealer's up card along the top. Each iteration the range of swappable items shrinks. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs. append(card1) if card1 in deck: deck. To do this we simply create a drawCard method that takes in self. This form allows you to draw playing cards from randomly shuffled decks. append(card) A method like this that uses another function without doing much real work is sometimes called a veneer. *; import java. Sep 25, 2013 · What I mean to say is imagine a deck of cards, to be "shuffled". You’ll start with simple projects, like a factoring program and a quadratic-equation solver, and then create more complex projects once you’ve gotten the hang of things. Regardless of where you are this workout is a quick and easy way to get your sweat on with no equipment needed! All you need is a deck of cards and around 30 minutes for this full body workout. It's simple to read, the code is clean, it's testable, it's just plain a pleasant experience. In this article, we will create python script that reads a CSV or TSV file and transforms its data into a deck. Magic Tricks Card It's our willingness to be caught up in an illusion - and our curiosity as to how it is we're being deceived - that has allowed the art of performing magic tricks to endure for some many centuries. On the end deal_card(card), why i put card because my h/w say so, but if you had other answer i'll be good to listen what you say. I don't know about you, but when I'm playing card games with my family and friends, they're not patient enough for me to perform 12 riffle shuffles. # python_shuffle a deck of card. Nov 17, 2019 · However, if you want to test your knowledge based on a predefined list of words, it would be convenient to generate a deck automatically. - DYZ Jun 8 '18 at 23:58. You can vote up the examples you like or vote down the ones you don't like. Think of it like Apples to Apples for horrible people. my thought here is to have a list for the deck, and a list for the hand. Consider creating a private helper method to fill the ArrayList,. Create Deck. In this tutorial, we will learn how to print a random card from the deck of playing cards in Java. If you don’t like one of the exercises I’ve added, you can customize it for you. The following are code examples for showing how to use gensim. Tienes que intentar tener más puntos que el otro, sin pasarse de 21. See the Python Library Reference for more information on the non-uniform generators. A card is a tuple containing a number between 1 and 13 representing the cards value and a string contianing. Shuffle the deck using random. This website uses cookies to ensure you get the best experience on our website. Shuffle a given array using Fisher–Yates shuffle Algorithm Given an array, write a program to generate a random permutation of array elements. Work through the deck in order or shuffle it up for a new study session every time. CODE ON YOUR MOBILE. HINT: you will need to repeat this ArrayList-filling process later for your shuffle () method. I believe my. The two sequences are numbers from 1 to 13 and the four suits. Also note that online casinos shuffle the deck after each deal, so it is impossible to count cards when playing blackjack online. In theory, it would make sense to make a request that would draw one or two cards each time a player in the game clicks a button to draw a card. This is a way of making the cards look like they are shuffled in random order to the casual observer but follow a repeatable pattern. Each piece has roughly n/2 cards. Sample Solution: Python Code:. With 52 cards an ideal structure would have 6 levels (log 2 (52) ~= 6), though if you dig into the skip lists even that could be reduced to a smaller number. random () function returns a floating-point number between the range [0,1) , where 0 (inclusive) and 1 (exclusive). The merged deck is now the new "shuffled" deck; One iteration of the overhand shuffle is defined as: Take a group of consecutive cards from the top of the deck. @staticmethod. Enlarge the cards to fit the screen or shrink them for a mobile device. 31: def shuffle 32: @cards. Posted 26 March 2012 - 08:43 PM. The optional argument random is a 0-argument function returning a random float in [0. Make a Hand. The 21-card trick The Magic effect: Have your friend shuffle a pack of cards and then you deal out single cards left to right into 3 piles of 7 cards, all face up. The random module will shuffle these decks. A true deal would remove a card from the deck and put it in another structure. What you will make. But this approach is mathematically random. No description. I added the small feature of displaying your updated hand total after hitting.