none
whats wrong with this program to study blackjack? RRS feed

  • Question

  • HGJ552

     

    this program simulates a chance game in which the house has an edge of 2%

     

    but the player has the advanatge that knowing the first cards he can chose to go on or surrender

     

    if he surrenders he loses half of the money he bet

     

    but according the first cards he knows the probability of winning varies from 25% to 75%

     

    i suppose theres got to be something wrong at this program but im not sure what 

    • Changed type litdevModerator Sunday, February 27, 2011 11:18 AM This is a question
    Sunday, February 27, 2011 1:19 AM

Answers

  • Any ideas?

    Got a program code so we can check it out?

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)

    The code was at the top (pretty easy to miss, though): HGJ552

    I think your problem is the variable "bob". It is never declared and never has any real value, as far as I can tell. Can you please explain what it is for?


    Please mark any answers and "vote as helpful" any posts that help you!

    Sunday, October 28, 2012 4:54 PM
    Answerer
  • This question from Feb 2011 was one of a series by Antonio about probability and the answers to this were broadly covered in related posts before and after this one. 

    If an uninitialized variable gets through the compiler validation (usually if it is in a Sub) but is used before initialized, it is assumed to be "" or 0 so in this case it is OK, although it is always best to initialize all variables of course.

    If by any chance Antonio is still working on this, then I think more details on this particular variant of probability calculation needs more details about exactly what it is supposed to do and what isn't working.

    Sunday, October 28, 2012 5:04 PM
    Moderator

All replies

  • Any ideas?

    Got a program code so we can check it out?

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)

    Sunday, October 28, 2012 5:28 AM
    Owner
  • Any ideas?

    Got a program code so we can check it out?

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)

    The code was at the top (pretty easy to miss, though): HGJ552

    I think your problem is the variable "bob". It is never declared and never has any real value, as far as I can tell. Can you please explain what it is for?


    Please mark any answers and "vote as helpful" any posts that help you!

    Sunday, October 28, 2012 4:54 PM
    Answerer
  • You guys realise that this was posted in February 2011? The OP has probably forgotten about it.
    Sunday, October 28, 2012 4:57 PM
  • This question from Feb 2011 was one of a series by Antonio about probability and the answers to this were broadly covered in related posts before and after this one. 

    If an uninitialized variable gets through the compiler validation (usually if it is in a Sub) but is used before initialized, it is assumed to be "" or 0 so in this case it is OK, although it is always best to initialize all variables of course.

    If by any chance Antonio is still working on this, then I think more details on this particular variant of probability calculation needs more details about exactly what it is supposed to do and what isn't working.

    Sunday, October 28, 2012 5:04 PM
    Moderator
  • You guys realise that this was posted in February 2011? The OP has probably forgotten about it.

    We know. We are going through and cleaning up the forums. I am know an answerer and helping Mr. Price go through and answer all the old answers. If the OP does not return in 7 days, we mark the answer. 

    Actually, the chances of the OP coming back are not bad if he/she had notifications turned on for the thread: they would get an email and they would probably come back. Of course, we don't subscribe to every thread though. Still, it is a chance.


    Please mark any answers and "vote as helpful" any posts that help you!

    Sunday, October 28, 2012 5:05 PM
    Answerer
  • Another reason is that 3K+ people visited this thread for some reason. It's sad to think there's nothing for them when they get here. Thanks LitDev and Gungan!

    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)

    Monday, October 29, 2012 5:43 AM
    Owner