楼主需要PHP编写,想来是需要与服务器交互了。

解决方案 »

  1.   

    http://kossi.physics.hmc.edu/courses/p117/Project/1999/neural/bjanal.html
      

  2.   

    楼上是什么啊?看不懂!Blackjack Analysis
    Although blackjack is a fairly simple game, the manner in which probabilities layer upon each other makes mathematical analysis difficult. A player wants to hit if the probability of winning after a hit is greater than the probability of winning before a hit. The difficulty comes about when we allow the player multiple hits because we must find the maximum probability from all possible paths. 
    For this reason, blackjack strategies are usually developed through trial and error. A couple of decades ago Dr. Thorp simulated 100 million blackjack games and published the results. Other famous card strategists, such as Hoyle, have produced countless tables for various versions of casino blackjack. For the sake of simplicity, we will focus on Thorp's single-deck strategy (our neural network was trained with only one deck). Here is Thorp's published table: 
     
    Each table entry corresponds to the player's hand value crossed with the dealer's showing card. The player must either hit (H), stand (S), double-down (D), or split (P). Thorp's table assumes logical play for those hand values not included in the left-most column: always hit given a hand value less than 8 and always stay given a hand value over 16 (or over soft 19). A few trends in this fairly standard blackjack strategy are worth noting. In the 12-16 region Thorp claims that players should stand if the dealer's card is below a 7 and hit if the dealer is showing a 7 through ace. The dealers top card is a strong indicator of the dealer's likelihood of busting, the only situation in which a player will win with a hand value of 17 or less. Because there are four card types with a value of 10 and only one card type with every other value 1-9, the dealer's most likely second card is a 10. Given that the dealer is showing a 7, 8, 9, 10, or ace, it's probable that the dealer will reach a sum between 17 and 21 without hitting at all. If the dealer has any other top card he will have to hit at least once, significantly increasing the chances of busting. 
    Doubling down and splitting generally occurs only when the players chance of winning is greater than 50%, as otherwise the player would just lose his money faster. These two options let the player retard money loss by betting more in the occasional case that the odds are in his favor. Thorp's strategy shows how the player should never double down given a hard sum of 12 because the likelihood of busting is very large (the next card has a significant chance of being a 10). For soft sums we see that doubling down is generally profitable if the dealer has a high bust likelihood: the player is guaranteed not to bust and will occasionally get a good hand. Because the dealer will probably bust, the good hand is generally not needed. Note that Thorp never recommends a split for 44 and 55 because these are the cards that lead to the most likely bust probabilities. Given 22 and 33 Thorp only recommends splitting when the dealer's bust probability is greater than the player's. For high pairs splitting is good because the player is likely to get a respectable hand. 
    Concerning doubling down, an exception must be made for high soft sums because in such cases doubling down still yields a win probability larger than 50%. In this case, however, standing results in a win probability much larger than the corresponding double down probability so that even after double down wins are multiplied by two standing is still more profitable. 
    While there are a couple of easy to recognize heuristics in determining the correct decision at a given player sum and dealer card, the actual calculation is highly involved and by no means simple. In some cases the correct choice may differ as a result of a fractional percent difference in the dealer's expected hand value. At this point we all throw up our hands and say, "let the computer figure it out." If we simulate enough games with random decks the error on our optimal strategy will drop to zero (Thorp, for example). Or, we try a dynamic programming approach to solving blackjack...
      

  3.   

    to  xuzuning(唠叨):
    呵呵~~好,不过昨天接了个小项目,大概一个星期完成。
    完成了我们再继续!
    个人觉得蛮有意思,动手动脑,喻教于乐……