Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

There are a few points of which to beware. First, I believe (this needs checking & I'm not going to do it today) that in Blackjack, an Ace can count as 1 or 11. Second, the odds of drawing a card of a given value are not the same, either at any time or at all times. That needs explanation in two parts. (A) Of the 52 cards in a pack, there are 16 with a value of 10. (B) After you have drawn one card, the odds change, so that if you have a deck of one pack, the chance of drawing a card with a value of 10 is 16/52. But once you have drawn one, the odds change to 15/51, and so on (if you draw a non-10, the odds change to 16/51 - still different). Finally, I believe that casinos use a deck of six packs, although this may have changed since the days of Strategic Investments (JFGI - you can legally beat the house at Blackjack).

However many packs you include in your deck, you might well start with the standard dealing algorithm I demonstrated in Re: Random data generation. and Re: getting random number 8 times never the same, although you will need to amend it to deal cards one by one rather than use the $length variable I used in those.

Regards,

John Davies


In reply to Re: Simple Blackjack progam help by davies
in thread Simple Blackjack progam help by ria1328

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (11)
    As of 2014-11-28 09:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (194 votes), past polls