为了好玩:二十一点模拟器-程序员宅基地

介绍

您是否想过为房屋边缘指定特定的规则集? 你真的可以数卡打败房子吗? 优势到底有多大? 当发牌者显示7时,将硬16击中真的是最好的策略吗? 所有这些以及更多这些都可以通过此VBScript二十一点模拟器得到解答。 插入您要测试的规则,修改基本策略,计数值,指数,下注坡道等。 看看它们如何影响整个房屋的优势!

如何使用

大多数脚本参数都在注释后面脚本顶部的常量定义中。 其余的位于“初始化”子例程的底部。 在此定义下注坡度,指数,基本策略和计数值。

您可以在这里找到基本的策略计算器:

http://wizardofodds.com/games/blackj...gy/calculator/效果 统计信息

要模拟两层二十一点的一百万场游戏,大约要花费10分钟(或花费一分钟)。

杂项信息

不利的优势意味着它有利于房屋,并且您在模拟过程中损失了金钱。 一套不计其数的标准规则和完善的基本策略可以使房子获利约半数。

模拟的数量可以将其提高到约1.6%,这对您有利。 这是一个非常小的优势,可以在任何一场比赛中产生很大的差异。 这意味着在任何一次会议上,您都可能会亏损。 但是在许多游戏中,您的表现只是一点点。 您可以通过多次运行脚本进行少量模拟(例如大约二十一点二十一点游戏)来查看此情况。 报告的优势将在正面和负面之间来回波动。 但是运行它进行大量的模拟,您会看到真正的优势发挥出来。

关键要点是不要指望将每一场二十一点变成一场胜利。

' real world blackjack simulation
' designed with KO variant (OK qfit.com) indexes in mind
' modify constants, basic strategy, betting ramps, indexes, and count values as needed
' default values are for 2 decks, KO variant count, no double after split, dealer hits soft 17, late surrender allowed
'
' created on 10/31/2014
' version 1.0
'
' possible additions:
' add ability to calculate true count for balanced count systems
' add basic strategy defaults based on rule sets
' add ability to choose counting strategy
' add count values based on counting strategy
' add betting ramp values based on counting strategy
' add indexes based on counting strategy
' add initial count and insurance count based on counting strategy
' modify penetration to use percentage
' add constant for turning on and off surrender
' add rate of error on count as a way to account for human errors or to disguise counting
' add rate of error on basic strategy as a way to account for human errors or to disguise counting
' add sessions: session max loss before stopping, session max win before stopping
' stop playing deck after count gets below a certain number
' test up and pull betting system, streak count
' add other players at table with choice to pick position
'
' strategy key:
' S = stand
' RS = surrender, otherwise stand
' H = hit
' RH = surrender, otherwise hit
' DH = double, otherwise hit
' DS = double, otherwise stand
' P = split
' RP = surrender, otherwise split 
Option Explicit 
Const NumSims = 1000000
Const NumDecks = 2
Const Penetration = 70 ' Number of cards dealt after which the deck is shuffled
Const InitialCount = -4 ' For KO variant count, initial count is (Number of Decks - 1) * -4
Const BurnCards = 1 ' Number of cards burned before first hand is dealt
Const InsuranceCount = 3 ' Set to high number if you never want to take insurance
Const NumMaxSplits = 4 ' Max 4
Const BJPayoutAmount = 1.5 ' Use 1.5 for 3:2 and 1.2 for 6:5
Const AllowDoubleAfterSplit = False
Const CanHitSplitAces = False
Const CanResplitAces = False
Const DealerHitSoft17 = True
Const Auditing = False
Const UseIndexes = True
Const UseBettingRamp = True
Const LetItRide = False ' Modify bet downwards only if last hand was a loss. Usually used as one method of camoflaging counting.
Const UseFibonnaciBetting = False
Const AuditFileLocation = "C:\IBM\results.txt" 
Dim StandardDeck(51, 1), Decks(), BettingRamp(3, 1), CountValues(10)
Dim HardStrategy(21, 10), SoftStrategy(21, 10), SplitStrategy(10, 10), Indexes(8, 4)
Dim runningCount, deckPosition, simCount, bankRoll, betSize, wagers
Dim handCards(4, 9), handData(4, 3), numHands, i, strDecision, lastHandWon, lastBet
Dim lowBankRoll, highBankRoll, numHandsPlayed, j, startTime, endTime
Dim f, x, s 
If Auditing Then Set f = CreateObject("Scripting.FileSystemObject").CreateTextFile(AuditFileLocation) 
' Indexes:
' 0 = runningCount value
' 1 = hand value
' 2 = dealer face up card
' 3 = new strategy 
' BettingRamp:
' 0 = runningCount value
' 1 = betSize at value 
' handData:
' 0 = amount bet
' 1 = hand value
' 2 = soft hand indicator
' 3 = number of cards 
Initialize()
InitializeDecks(NumDecks) 
For simCount = 1 To NumSims
    ShuffleDecks() 
    If Auditing Then 
        f.WriteLine "Shuffle " & simCount
        For x = 0 To UBound(Decks)
            f.WriteLine Decks(x, 0) & Decks(x, 1)
        Next
        f.WriteLine ""
    End If 
    runningCount = InitialCount
    deckPosition = BurnCards
    betSize = 1 
    Do Until deckPosition > Penetration
        Erase handCards
        Erase handData
        numHands = 1 
        betSize = 1
        If UseBettingRamp Then
            For i = 0 To UBound(BettingRamp)
                If runningCount >= BettingRamp(i, 0) Then
                    betSize = BettingRamp(i, 1)
                End If
            Next
        End If 
        If LetItRide Then
            If lastHandWon = True And lastBet > betSize Then
                betSize = lastBet
            End If
            lastBet = betSize
            lastHandWon = False
        End If 
        If Auditing Then f.WriteLine "New Hand, Count = " & runningCount & ", Bet = " & betSize & ", Bankroll = " & bankRoll 
        handData(1, 0) = betSize
        handData(1, 3) = 2
        handData(0, 3) = 2 
        ' Player's first card
        handCards(1, 0) = deckPosition
        If Decks(deckPosition, 0) = 1 Then 
            handData(1, 1) = 11
            handData(1, 2) = 1
        Else
            handData(1, 1) = Decks(deckPosition, 0)
        End If
        runningCount = runningCount + CountValues(Decks(deckPosition, 0))
        deckPosition = deckPosition + 1 
        ' Dealer's first card
        handCards(0, 0) = deckPosition
        If Decks(deckPosition, 0) = 1 Then 
            handData(0, 1) = 11
            handData(0, 2) = 1
        Else
            handData(0, 1) = Decks(deckPosition, 0)
        End If
        deckPosition = deckPosition + 1 
        ' Player's second card
        handCards(1, 1) = deckPosition
        If Decks(deckPosition, 0) = 1 And handData(1, 1) + 11 <= 21 Then 
            handData(1, 1) = handData(1, 1) + 11
            handData(1, 2) = 1
        Else
            handData(1, 1) = handData(1, 1) + Decks(deckPosition, 0)
        End If
        runningCount = runningCount + CountValues(Decks(deckPosition, 0))
        deckPosition = deckPosition + 1 
        ' Dealer's second card
        handCards(0, 1) = deckPosition
        If Decks(deckPosition, 0) = 1 And handData(0, 1) + 11 <= 21 Then 
            handData(0, 1) = handData(0, 1) + 11
            handData(0, 2) = 1
        Else
            handData(0, 1) = handData(0, 1) + Decks(deckPosition, 0)
        End If
        runningCount = runningCount + CountValues(Decks(deckPosition, 0))
        deckPosition = deckPosition + 1 
        If Auditing Then 
            f.WriteLine "Dealer Face Up Card: " & Decks(handCards(0, 1), 0) & Decks(handCards(0, 1), 1)
            f.WriteLine "Player's Cards:      " & Decks(handCards(1, 0), 0) & Decks(handCards(1, 0), 1) & ", " & Decks(handCards(1, 1), 0) & Decks(handCards(1, 1), 1)
            f.WriteLine "New Count: " & runningCount
        End If 
        If runningCount >= InsuranceCount And Decks(handCards(0, 1), 0) = 1 Then
            wagers = wagers + (handData(1, 0) / 2)
            If handData(0, 1) <> 21 Then
                bankRoll = bankRoll - (handData(1, 0) / 2)
                If Auditing Then f.WriteLine "Took Insurance, Dealer did not have 21, Bankroll = " & bankRoll
            Else
                bankRoll = bankRoll + (handData(1, 0) / 2) * 3
                If Auditing Then f.WriteLine "Took Insurance, Dealer had 21, Bankroll = " & bankRoll
            End If
        End If 
        If handData(0, 1) = 21 Then
            If handData(1, 1) <> 21 Then
                bankRoll = bankRoll - handData(1, 0)
                If Auditing Then f.WriteLine "Hand Outcome: Dealer Blackjack, Bankroll = " & bankRoll
            End If
        ElseIf handData(1, 1) = 21 Then
            bankRoll = bankRoll + handData(1, 0) * BJPayoutAmount
            If Auditing Then f.WriteLine "Hand Outcome: Player Blackjack"
            lastHandWon = True
        ElseIf handData(1, 2) = 1 And Left(SoftStrategy(handData(1, 1), Decks(handCards(0, 1), 0)), 1) = "R" Then
            bankRoll = bankRoll - (handData(1, 0) / 2)
            If Auditing Then f.WriteLine "Hand Outcome: Surrender, Bankroll = " & bankRoll
        ElseIf handData(1, 2) <> 1 And Left(HardStrategy(handData(1, 1), Decks(handCards(0, 1), 0)), 1) = "R" Then
            bankRoll = bankRoll - (handData(1, 0) / 2)
            If Auditing Then f.WriteLine "Hand Outcome: Surrender, Bankroll = " & bankRoll
        ElseIf Decks(handCards(1, 0), 0) = Decks(handCards(1, 1), 0) And Left(SplitStrategy(Decks(handCards(1, 0), 0), Decks(handCards(0, 1), 0)), 1) = "R" Then
            bankRoll = bankRoll - (handData(1, 0) / 2)
            If Auditing Then f.WriteLine "Hand Outcome: Surrender, Bankroll = " & bankRoll
        Else
            ' Handle splits
            i = 1
            Do Until i > numHands
                If Decks(handCards(i, 0), 0) = Decks(handCards(i, 1), 0) And Right(SplitStrategy(Decks(handCards(1, 0), 0), Decks(handCards(0, 1), 0)), 1) = "P" And numHands < NumMaxSplits Then
                    numHands = numHands + 1
                    handData(numHands, 0) = handData(i, 0)
                    handData(numHands, 2) = handData(i, 2)
                    handData(numHands, 3) = 2
                    handCards(numHands, 0) = handCards(i, 1) 
                    If Decks(handCards(i, 0), 0) = 1 Then
                        handData(numHands, 1) = 11
                        handData(i, 1) = 11
                    Else
                        handData(numHands, 1) = Decks(handCards(i, 0), 0)
                        handData(i, 1) = Decks(handCards(i, 0), 0)
                    End If 
                    ' Deal a card to each hand
                    handCards(i, 1) = deckPosition
                    If Decks(deckPosition, 0) = 1 And handData(i, 1) + 11 <= 21 Then 
                        handData(i, 1) = handData(i, 1) + 11
                        handData(i, 2) = 1
                    Else
                        handData(i, 1) = handData(i, 1) + Decks(deckPosition, 0)
                    End If
                    runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                    deckPosition = deckPosition + 1 
                    handCards(numHands, 1) = deckPosition
                    If Decks(deckPosition, 0) = 1 And handData(numHands, 1) + 11 <= 21 Then 
                        handData(numHands, 1) = handData(numHands, 1) + 11
                        handData(numHands, 2) = 1
                    Else
                        handData(numHands, 1) = handData(numHands, 1) + Decks(deckPosition, 0)
                    End If
                    runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                    deckPosition = deckPosition + 1 
                    If CanResplitAces = False And Decks(handCards(1, 0), 0) = 1 Then
                        i = 999
                    End If
                Else
                    i = i + 1
                End If
            Loop 
            ' Player decisions
            For i = 1 To numHands
                strDecision = ""
                s = "" 
                If numHands > 1 And CanHitSplitAces = False And Decks(handCards(1, 0), 0) = 1 Then
                    strDecision = "S"
                End If 
                Do Until strDecision = "S"
                    If handData(i, 2) = 1 Then
                        strDecision = SoftStrategy(handData(i, 1), Decks(handCards(0, 1), 0))
                    Else
                        strDecision = HardStrategy(handData(i, 1), Decks(handCards(0, 1), 0))
                    End If 
                    ' Modify decision based on count indexes
                    If UseIndexes Then
                        For j = 0 To UBound(Indexes)
                            If runningCount >= Indexes(j, 0) Then
                                If handData(i, 1) = Indexes(j, 1) And Decks(handCards(0, 1), 0) = Indexes(j, 2) And handData(i, 2) <> 1 Then
                                    strDecision = Indexes(j, 3)
                                End If
                            End If
                        Next
                    End If 
                    s = s & strDecision & ", " 
                    Select Case strDecision
                        Case "S"
                        Case "RS"
                            strDecision = "S"
                        Case "H"
                            ' deal a card
                            handCards(i, handData(i, 3)) = deckPosition
                            If Decks(deckPosition, 0) = 1 And (handData(i, 1) + 11) <= 21 Then 
                                handData(i, 1) = handData(i, 1) + 11
                                handData(i, 2) = 1
                            ElseIf handData(i, 2) = 1 And (handData(i, 1) + Decks(deckPosition, 0)) > 21 Then
                                handData(i, 2) = 0
                                handData(i, 1) = handData(i, 1) - 10 + Decks(deckPosition, 0)
                            Else
                                handData(i, 1) = handData(i, 1) + Decks(deckPosition, 0)
                            End If
                            handData(i, 3) = handData(i, 3) + 1
                            runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                            deckPosition = deckPosition + 1 
                            ' check for bust
                            If handData(i, 1) > 21 Then
                                strDecision = "S"
                            End If
                        Case "RH"
                            ' deal a card
                            handCards(i, handData(i, 3)) = deckPosition
                            If Decks(deckPosition, 0) = 1 And (handData(i, 1) + 11) <= 21 Then 
                                handData(i, 1) = handData(i, 1) + 11
                                handData(i, 2) = 1
                            ElseIf handData(i, 2) = 1 And (handData(i, 1) + Decks(deckPosition, 0)) > 21 Then
                                handData(i, 2) = 0
                                handData(i, 1) = handData(i, 1) - 10 + Decks(deckPosition, 0)
                            Else
                                handData(i, 1) = handData(i, 1) + Decks(deckPosition, 0)
                            End If
                            handData(i, 3) = handData(i, 3) + 1
                            runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                            deckPosition = deckPosition + 1 
                            ' check for bust
                            If handData(i, 1) > 21 Then
                                strDecision = "S"
                            End If
                        Case "DH"
                            If handData(i, 3) = 2 And (numHands = 1 Or AllowDoubleAfterSplit = True) Then
                                handData(i, 0) = handData(i, 0) * 2
                                strDecision = "S"
                                s = s & "Doubled, "
                            End If 
                            ' deal a card
                            handCards(i, handData(i, 3)) = deckPosition
                            If Decks(deckPosition, 0) = 1 And (handData(i, 1) + 11) <= 21 Then 
                                handData(i, 1) = handData(i, 1) + 11
                                handData(i, 2) = 1
                            ElseIf handData(i, 2) = 1 And (handData(i, 1) + Decks(deckPosition, 0)) > 21 Then
                                handData(i, 2) = 0
                                handData(i, 1) = handData(i, 1) - 10 + Decks(deckPosition, 0)
                            Else
                                handData(i, 1) = handData(i, 1) + Decks(deckPosition, 0)
                            End If
                            handData(i, 3) = handData(i, 3) + 1
                            runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                            deckPosition = deckPosition + 1 
                            'check for bust
                            If handData(i, 1) > 21 Then
                                strDecision = "S"
                            End If
                        Case "DS"
                            strDecision = "S" 
                            If handData(i, 3) = 2 And (numHands = 1 Or AllowDoubleAfterSplit = True) Then
                                handData(i, 0) = handData(i, 0) * 2
                                s = s & "Doubled, " 
                                ' deal a card
                                handCards(i, handData(i, 3)) = deckPosition
                                If Decks(deckPosition, 0) = 1 And (handData(i, 1) + 11) <= 21 Then 
                                    handData(i, 1) = handData(i, 1) + 11
                                    handData(i, 2) = 1
                                ElseIf handData(i, 2) = 1 And (handData(i, 1) + Decks(deckPosition, 0)) > 21 Then
                                    handData(i, 2) = 0
                                    handData(i, 1) = handData(i, 1) - 10 + Decks(deckPosition, 0)
                                Else
                                    handData(i, 1) = handData(i, 1) + Decks(deckPosition, 0)
                                End If
                                handData(i, 3) = handData(i, 3) + 1
                                runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                                deckPosition = deckPosition + 1
                            End If
                        Case Else
                            WScript.Echo handData(i, 1) & vbcrlf & Decks(handCards(0, 1), 0) & vbcrlf & handData(i, 2) & vbcrlf & i & _
                            SoftStrategy(handData(i, 1), Decks(handCards(0, 1), 0)) & vbcrlf & HardStrategy(handData(i, 1), Decks(handCards(0, 1), 0)) & vbcrlf & _
                            Decks(handCards(i, 0), 0) & "," & Decks(handCards(i, 1), 0) & vbcrlf & handData(i, 3)
                    End Select
                Loop 
                If Auditing Then f.WriteLine "Hand " & i & " Decisions: " & s
            Next 
            ' dealer decisions
            strDecision = ""
            Do Until strDecision = "S"
                If handData(0, 1) < 17 Or (handData(0, 1) = 17 And handData(0, 2) = 1 And DealerHitSoft17 = True) Then
                    ' deal a card
                    handCards(0, handData(0, 3)) = deckPosition
                    If Decks(deckPosition, 0) = 1 And (handData(0, 1) + 11) <= 21 Then 
                        handData(0, 1) = handData(0, 1) + 11
                        handData(0, 2) = 1
                    ElseIf handData(0, 2) = 1 And (handData(0, 1) + Decks(deckPosition, 0)) > 21 Then
                        handData(0, 2) = 0
                        handData(0, 1) = handData(0, 1) - 10 + Decks(deckPosition, 0)
                    Else
                        handData(0, 1) = handData(0, 1) + Decks(deckPosition, 0)
                    End If
                    handData(0, 3) = handData(0, 3) + 1
                    runningCount = runningCount + CountValues(Decks(deckPosition, 0))
                    deckPosition = deckPosition + 1
                Else
                    strDecision = "S"
                End If
            Loop 
            ' hand outcomes
            For i = 1 To NumHands
                If Auditing Then 
                    f.WriteLine "Hand " & i & " Bet = "  & handData(i, 0) & ", Value = " & handData(i, 1) & ", Soft Hand = " & handData(i, 2) & ", Number of Cards = " & handData(i, 3)
                    s = ""
                    For x = 0 To handData(i, 3) - 1
                        s = s & Decks(handCards(i, x), 0) & Decks(handCards(i, x), 1) & ", "
                    Next
                    f.WriteLine "Hand " & i & " Final Cards: " & s
                End If 
                wagers = wagers + handData(i, 0)
                If handData(i, 1) > 21 Then
                    ' player bust
                    bankRoll = bankRoll - handData(i, 0)
                    If Auditing Then f.WriteLine "Hand Outcome: Player Bust"
                ElseIf handData(0, 1) > 21 Then
                    ' dealer bust
                    bankRoll = bankRoll + handData(i, 0)
                    lastHandWon = True
                    If Auditing Then f.WriteLine "Hand Outcome: Dealer Bust"
                ElseIf handData(i, 1) < handData(0, 1) Then
                    ' dealer wins
                    bankRoll = bankRoll - handData(i, 0)
                    If Auditing Then f.WriteLine "Hand Outcome: Dealer Wins"
                ElseIf handData(i, 1) > handData(0, 1) Then
                    ' player wins
                    bankRoll = bankRoll + handData(i, 0)
                    lastHandWon = True
                    If Auditing Then f.WriteLine "Hand Outcome: Player Wins"
                ElseIf handData(i, 1) = handData(0, 1) Then
                    If Auditing Then f.WriteLine "Hand Outcome: Push"
                Else
                    WScript.Echo "Hand Outcome Error"
                End If
            Next
        End If 
        runningCount = runningCount + CountValues(Decks(handCards(0, 0), 0))
        numHandsPlayed = numHandsPlayed + numHands
        If bankRoll < lowBankRoll Then lowBankRoll = bankRoll
        If bankRoll > highBankRoll Then highBankRoll = bankRoll 
        If Auditing Then 
            f.WriteLine "Dealer's Value = " & handData(0, 1) & ", Soft Hand = " & handData(0, 2) & ", Number of Cards = " & handData(0, 3)
            s = ""
            For i = 0 To handData(0, 3) - 1
                s = s & Decks(handCards(0, i), 0) & Decks(handCards(0, i), 1) & ", "
            Next
            f.WriteLine "Dealer's Final Cards: " & s 
            f.WriteLine "Ending Count = " & runningCount & ", Bankroll = " & bankRoll
            f.WriteLine ""
        End If
    Loop
Next 
endTime = Now()
WScript.Echo _
    "Started: " & startTime & vbcrlf & _
    "Lowest Bank Roll: " & lowBankRoll & vbcrlf & _
    "Highest Bank Roll: " & highBankRoll & vbcrlf & _
    "Ending Bank Roll: " & bankRoll & vbcrlf & _
    "Total Hands Played: " & numHandsPlayed & vbcrlf & _
    "Total Wagers: " & wagers & vbcrlf & _
    "Average Wager: " & Round(wagers / numHandsPlayed, 2) & vbcrlf & _
    "Advantage: " & Round(bankRoll / wagers * 100, 4) & vbcrlf & _
    "Ended: " & endTime & vbcrlf & _
    "Elapsed Time in Minutes: " & DateDiff("n", startTime, endTime)    
Sub InitializeDecks(numOfDecks)
    Dim i, j 
    Redim Decks(52 * numOfDecks - 1, 1) 
    For i = 1 To numOfDecks
        For j = 0 To 51
            Decks((i - 1) * 52 + j, 0) = StandardDeck(j, 0)
            Decks((i - 1) * 52 + j, 1) = StandardDeck(j, 1)
        Next
    Next
End Sub 
Sub ShuffleDecks()
    Dim i, j, value, suit, x 
    Randomize 
    ' Fisher Yates Shuffling Algorithm
    x = UBound(Decks) - 1
    For i = 0 To x
        j = Int(Rnd() * (x - i + 2)) + i
        value = Decks(j, 0)
        suit = Decks(j, 1)
        Decks(j, 0) = Decks(i, 0)
        Decks(j, 1) = Decks(i, 1)
        Decks(i, 0) = value
        Decks(i, 1) = suit
    Next
End Sub 
Sub Initialize()
    startTime = Now()
    bankRoll = 0
    wagers = 0
    lowBankRoll = 0
    highBankRoll = 0
    numHandsPlayed = 0 
    CountValues(2) = 1
    CountValues(3) = 1
    CountValues(4) = 1
    CountValues(5) = 1
    CountValues(6) = 1
    CountValues(7) = 1
    CountValues(8) = 0
    CountValues(9) = 0
    CountValues(10) = -1
    CountValues(1) = -1 
    BettingRamp(0, 0) = 1
    BettingRamp(0, 1) = 2
    BettingRamp(1, 0) = 2
    BettingRamp(1, 1) = 3
    BettingRamp(2, 0) = 3
    BettingRamp(2, 1) = 5
    BettingRamp(3, 0) = 4
    BettingRamp(3, 1) = 6 
    Indexes(0, 0) = 0
    Indexes(0, 1) = 16
    Indexes(0, 2) = 10
    Indexes(0, 3) = "S" 
    Indexes(1, 0) = 4
    Indexes(1, 1) = 15
    Indexes(1, 2) = 10
    Indexes(1, 3) = "S" 
    Indexes(2, 0) = 4
    Indexes(2, 1) = 12
    Indexes(2, 2) = 2
    Indexes(2, 3) = "S" 
    Indexes(3, 0) = 4
    Indexes(3, 1) = 12
    Indexes(3, 2) = 3
    Indexes(3, 3) = "S" 
    Indexes(4, 0) = 4
    Indexes(4, 1) = 9
    Indexes(4, 2) = 7
    Indexes(4, 3) = "DH" 
    Indexes(5, 0) = 4
    Indexes(5, 1) = 8
    Indexes(5, 2) = 6
    Indexes(5, 3) = "DH" 
    Indexes(6, 0) = 4
    Indexes(6, 1) = 8
    Indexes(6, 2) = 5
    Indexes(6, 3) = "DH" 
    Indexes(7, 0) = 4
    Indexes(7, 1) = 10
    Indexes(7, 2) = 10
    Indexes(7, 3) = "DH" 
    Indexes(8, 0) = 4
    Indexes(8, 1) = 10
    Indexes(8, 2) = 1
    Indexes(8, 3) = "DH" 
    StandardDeck(0, 0) = 1
    StandardDeck(0, 1) = "Ace of Diamonds"
    StandardDeck(1, 0) = 2
    StandardDeck(1, 1) = " of Diamonds"
    StandardDeck(2, 0) = 3
    StandardDeck(2, 1) = " of Diamonds"
    StandardDeck(3, 0) = 4
    StandardDeck(3, 1) = " of Diamonds"
    StandardDeck(4, 0) = 5
    StandardDeck(4, 1) = " of Diamonds"
    StandardDeck(5, 0) = 6
    StandardDeck(5, 1) = " of Diamonds"
    StandardDeck(6, 0) = 7
    StandardDeck(6, 1) = " of Diamonds"
    StandardDeck(7, 0) = 8
    StandardDeck(7, 1) = " of Diamonds"
    StandardDeck(8, 0) = 9
    StandardDeck(8, 1) = " of Diamonds"
    StandardDeck(9, 0) = 10
    StandardDeck(9, 1) = "Ten of Diamonds"
    StandardDeck(10, 0) = 10
    StandardDeck(10, 1) = "Jack of Diamonds"
    StandardDeck(11, 0) = 10
    StandardDeck(11, 1) = "Queen of Diamonds"
    StandardDeck(12, 0) = 10
    StandardDeck(12, 1) = "King of Diamonds"
    StandardDeck(13, 0) = 1
    StandardDeck(13, 1) = "Ace of Clubs"
    StandardDeck(14, 0) = 2
    StandardDeck(14, 1) = " of Clubs"
    StandardDeck(15, 0) = 3
    StandardDeck(15, 1) = " of Clubs"
    StandardDeck(16, 0) = 4
    StandardDeck(16, 1) = " of Clubs"
    StandardDeck(17, 0) = 5
    StandardDeck(17, 1) = " of Clubs"
    StandardDeck(18, 0) = 6
    StandardDeck(18, 1) = " of Clubs"
    StandardDeck(19, 0) = 7
    StandardDeck(19, 1) = " of Clubs"
    StandardDeck(20, 0) = 8
    StandardDeck(20, 1) = " of Clubs"
    StandardDeck(21, 0) = 9
    StandardDeck(21, 1) = " of Clubs"
    StandardDeck(22, 0) = 10
    StandardDeck(22, 1) = "Ten of Clubs"
    StandardDeck(23, 0) = 10
    StandardDeck(23, 1) = "Jack of Clubs"
    StandardDeck(24, 0) = 10
    StandardDeck(24, 1) = "Queen of Clubs"
    StandardDeck(25, 0) = 10
    StandardDeck(25, 1) = "King of Clubs"
    StandardDeck(26, 0) = 1
    StandardDeck(26, 1) = "Ace of Hearts"
    StandardDeck(27, 0) = 2
    StandardDeck(27, 1) = " of Hearts"
    StandardDeck(28, 0) = 3
    StandardDeck(28, 1) = " of Hearts"
    StandardDeck(29, 0) = 4
    StandardDeck(29, 1) = " of Hearts"
    StandardDeck(30, 0) = 5
    StandardDeck(30, 1) = " of Hearts"
    StandardDeck(31, 0) = 6
    StandardDeck(31, 1) = " of Hearts"
    StandardDeck(32, 0) = 7
    StandardDeck(32, 1) = " of Hearts"
    StandardDeck(33, 0) = 8
    StandardDeck(33, 1) = " of Hearts"
    StandardDeck(34, 0) = 9
    StandardDeck(34, 1) = " of Hearts"
    StandardDeck(35, 0) = 10
    StandardDeck(35, 1) = "Ten of Hearts"
    StandardDeck(36, 0) = 10
    StandardDeck(36, 1) = "Jack of Hearts"
    StandardDeck(37, 0) = 10
    StandardDeck(37, 1) = "Queen of Hearts"
    StandardDeck(38, 0) = 10
    StandardDeck(38, 1) = "King of Hearts"
    StandardDeck(39, 0) = 1
    StandardDeck(39, 1) = "Ace of Spades"
    StandardDeck(40, 0) = 2
    StandardDeck(40, 1) = " of Spades"
    StandardDeck(41, 0) = 3
    StandardDeck(41, 1) = " of Spades"
    StandardDeck(42, 0) = 4
    StandardDeck(42, 1) = " of Spades"
    StandardDeck(43, 0) = 5
    StandardDeck(43, 1) = " of Spades"
    StandardDeck(44, 0) = 6
    StandardDeck(44, 1) = " of Spades"
    StandardDeck(45, 0) = 7
    StandardDeck(45, 1) = " of Spades"
    StandardDeck(46, 0) = 8
    StandardDeck(46, 1) = " of Spades"
    StandardDeck(47, 0) = 9
    StandardDeck(47, 1) = " of Spades"
    StandardDeck(48, 0) = 10
    StandardDeck(48, 1) = "Ten of Spades"
    StandardDeck(49, 0) = 10
    StandardDeck(49, 1) = "Jack of Spades"
    StandardDeck(50, 0) = 10
    StandardDeck(50, 1) = "Queen of Spades"
    StandardDeck(51, 0) = 10
    StandardDeck(51, 1) = "King of Spades" 
    HardStrategy(2, 2) = "H"
    HardStrategy(2, 3) = "H"
    HardStrategy(2, 4) = "H"
    HardStrategy(2, 5) = "H"
    HardStrategy(2, 6) = "H"
    HardStrategy(2, 7) = "H"
    HardStrategy(2, 8) = "H"
    HardStrategy(2, 9) = "H"
    HardStrategy(2, 10) = "H"
    HardStrategy(2, 1) = "H" 
    HardStrategy(4, 2) = "H"
    HardStrategy(4, 3) = "H"
    HardStrategy(4, 4) = "H"
    HardStrategy(4, 5) = "H"
    HardStrategy(4, 6) = "H"
    HardStrategy(4, 7) = "H"
    HardStrategy(4, 8) = "H"
    HardStrategy(4, 9) = "H"
    HardStrategy(4, 10) = "H"
    HardStrategy(4, 1) = "H" 
    HardStrategy(5, 2) = "H"
    HardStrategy(5, 3) = "H"
    HardStrategy(5, 4) = "H"
    HardStrategy(5, 5) = "H"
    HardStrategy(5, 6) = "H"
    HardStrategy(5, 7) = "H"
    HardStrategy(5, 8) = "H"
    HardStrategy(5, 9) = "H"
    HardStrategy(5, 10) = "H"
    HardStrategy(5, 1) = "H" 
    HardStrategy(6, 2) = "H"
    HardStrategy(6, 3) = "H"
    HardStrategy(6, 4) = "H"
    HardStrategy(6, 5) = "H"
    HardStrategy(6, 6) = "H"
    HardStrategy(6, 7) = "H"
    HardStrategy(6, 8) = "H"
    HardStrategy(6, 9) = "H"
    HardStrategy(6, 10) = "H"
    HardStrategy(6, 1) = "H" 
    HardStrategy(7, 2) = "H"
    HardStrategy(7, 3) = "H"
    HardStrategy(7, 4) = "H"
    HardStrategy(7, 5) = "H"
    HardStrategy(7, 6) = "H"
    HardStrategy(7, 7) = "H"
    HardStrategy(7, 8) = "H"
    HardStrategy(7, 9) = "H"
    HardStrategy(7, 10) = "H"
    HardStrategy(7, 1) = "H" 
    HardStrategy(8, 2) = "H"
    HardStrategy(8, 3) = "H"
    HardStrategy(8, 4) = "H"
    HardStrategy(8, 5) = "H"
    HardStrategy(8, 6) = "H"
    HardStrategy(8, 7) = "H"
    HardStrategy(8, 8) = "H"
    HardStrategy(8, 9) = "H"
    HardStrategy(8, 10) = "H"
    HardStrategy(8, 1) = "H" 
    HardStrategy(9, 2) = "DH"
    HardStrategy(9, 3) = "DH"
    HardStrategy(9, 4) = "DH"
    HardStrategy(9, 5) = "DH"
    HardStrategy(9, 6) = "DH"
    HardStrategy(9, 7) = "H"
    HardStrategy(9, 8) = "H"
    HardStrategy(9, 9) = "H"
    HardStrategy(9, 10) = "H"
    HardStrategy(9, 1) = "H" 
    HardStrategy(10, 2) = "DH"
    HardStrategy(10, 3) = "DH"
    HardStrategy(10, 4) = "DH"
    HardStrategy(10, 5) = "DH"
    HardStrategy(10, 6) = "DH"
    HardStrategy(10, 7) = "DH"
    HardStrategy(10, 8) = "DH"
    HardStrategy(10, 9) = "DH"
    HardStrategy(10, 10) = "H"
    HardStrategy(10, 1) = "H" 
    HardStrategy(11, 2) = "DH"
    HardStrategy(11, 3) = "DH"
    HardStrategy(11, 4) = "DH"
    HardStrategy(11, 5) = "DH"
    HardStrategy(11, 6) = "DH"
    HardStrategy(11, 7) = "DH"
    HardStrategy(11, 8) = "DH"
    HardStrategy(11, 9) = "DH"
    HardStrategy(11, 10) = "DH"
    HardStrategy(11, 1) = "DH" 
    HardStrategy(12, 2) = "H"
    HardStrategy(12, 3) = "H"
    HardStrategy(12, 4) = "S"
    HardStrategy(12, 5) = "S"
    HardStrategy(12, 6) = "S"
    HardStrategy(12, 7) = "H"
    HardStrategy(12, 8) = "H"
    HardStrategy(12, 9) = "H"
    HardStrategy(12, 10) = "H"
    HardStrategy(12, 1) = "H" 
    HardStrategy(13, 2) = "S"
    HardStrategy(13, 3) = "S"
    HardStrategy(13, 4) = "S"
    HardStrategy(13, 5) = "S"
    HardStrategy(13, 6) = "S"
    HardStrategy(13, 7) = "H"
    HardStrategy(13, 8) = "H"
    HardStrategy(13, 9) = "H"
    HardStrategy(13, 10) = "H"
    HardStrategy(13, 1) = "H" 
    HardStrategy(14, 2) = "S"
    HardStrategy(14, 3) = "S"
    HardStrategy(14, 4) = "S"
    HardStrategy(14, 5) = "S"
    HardStrategy(14, 6) = "S"
    HardStrategy(14, 7) = "H"
    HardStrategy(14, 8) = "H"
    HardStrategy(14, 9) = "H"
    HardStrategy(14, 10) = "H"
    HardStrategy(14, 1) = "H" 
    HardStrategy(15, 2) = "S"
    HardStrategy(15, 3) = "S"
    HardStrategy(15, 4) = "S"
    HardStrategy(15, 5) = "S"
    HardStrategy(15, 6) = "S"
    HardStrategy(15, 7) = "H"
    HardStrategy(15, 8) = "H"
    HardStrategy(15, 9) = "H"
    HardStrategy(15, 10) = "RH"
    HardStrategy(15, 1) = "RH" 
    HardStrategy(16, 2) = "S"
    HardStrategy(16, 3) = "S"
    HardStrategy(16, 4) = "S"
    HardStrategy(16, 5) = "S"
    HardStrategy(16, 6) = "S"
    HardStrategy(16, 7) = "H"
    HardStrategy(16, 8) = "H"
    HardStrategy(16, 9) = "H"
    HardStrategy(16, 10) = "RH"
    HardStrategy(16, 1) = "RH" 
    HardStrategy(17, 2) = "S"
    HardStrategy(17, 3) = "S"
    HardStrategy(17, 4) = "S"
    HardStrategy(17, 5) = "S"
    HardStrategy(17, 6) = "S"
    HardStrategy(17, 7) = "S"
    HardStrategy(17, 8) = "S"
    HardStrategy(17, 9) = "S"
    HardStrategy(17, 10) = "S"
    HardStrategy(17, 1) = "RS" 
    HardStrategy(18, 2) = "S"
    HardStrategy(18, 3) = "S"
    HardStrategy(18, 4) = "S"
    HardStrategy(18, 5) = "S"
    HardStrategy(18, 6) = "S"
    HardStrategy(18, 7) = "S"
    HardStrategy(18, 8) = "S"
    HardStrategy(18, 9) = "S"
    HardStrategy(18, 10) = "S"
    HardStrategy(18, 1) = "S" 
    HardStrategy(19, 2) = "S"
    HardStrategy(19, 3) = "S"
    HardStrategy(19, 4) = "S"
    HardStrategy(19, 5) = "S"
    HardStrategy(19, 6) = "S"
    HardStrategy(19, 7) = "S"
    HardStrategy(19, 8) = "S"
    HardStrategy(19, 9) = "S"
    HardStrategy(19, 10) = "S"
    HardStrategy(19, 1) = "S" 
    HardStrategy(20, 2) = "S"
    HardStrategy(20, 3) = "S"
    HardStrategy(20, 4) = "S"
    HardStrategy(20, 5) = "S"
    HardStrategy(20, 6) = "S"
    HardStrategy(20, 7) = "S"
    HardStrategy(20, 8) = "S"
    HardStrategy(20, 9) = "S"
    HardStrategy(20, 10) = "S"
    HardStrategy(20, 1) = "S" 
    HardStrategy(21, 2) = "S"
    HardStrategy(21, 3) = "S"
    HardStrategy(21, 4) = "S"
    HardStrategy(21, 5) = "S"
    HardStrategy(21, 6) = "S"
    HardStrategy(21, 7) = "S"
    HardStrategy(21, 8) = "S"
    HardStrategy(21, 9) = "S"
    HardStrategy(21, 10) = "S"
    HardStrategy(21, 1) = "S" 
    SoftStrategy(12, 2) = "H"
    SoftStrategy(12, 3) = "H"
    SoftStrategy(12, 4) = "H"
    SoftStrategy(12, 5) = "H"
    SoftStrategy(12, 6) = "H"
    SoftStrategy(12, 7) = "H"
    SoftStrategy(12, 8) = "H"
    SoftStrategy(12, 9) = "H"
    SoftStrategy(12, 10) = "H"
    SoftStrategy(12, 1) = "H" 
    SoftStrategy(13, 2) = "H"
    SoftStrategy(13, 3) = "H"
    SoftStrategy(13, 4) = "H"
    SoftStrategy(13, 5) = "DH"
    SoftStrategy(13, 6) = "DH"
    SoftStrategy(13, 7) = "H"
    SoftStrategy(13, 8) = "H"
    SoftStrategy(13, 9) = "H"
    SoftStrategy(13, 10) = "H"
    SoftStrategy(13, 1) = "H" 
    SoftStrategy(14, 2) = "H"
    SoftStrategy(14, 3) = "H"
    SoftStrategy(14, 4) = "DH"
    SoftStrategy(14, 5) = "DH"
    SoftStrategy(14, 6) = "DH"
    SoftStrategy(14, 7) = "H"
    SoftStrategy(14, 8) = "H"
    SoftStrategy(14, 9) = "H"
    SoftStrategy(14, 10) = "H"
    SoftStrategy(14, 1) = "H" 
    SoftStrategy(15, 2) = "H"
    SoftStrategy(15, 3) = "H"
    SoftStrategy(15, 4) = "DH"
    SoftStrategy(15, 5) = "DH"
    SoftStrategy(15, 6) = "DH"
    SoftStrategy(15, 7) = "H"
    SoftStrategy(15, 8) = "H"
    SoftStrategy(15, 9) = "H"
    SoftStrategy(15, 10) = "H"
    SoftStrategy(15, 1) = "H" 
    SoftStrategy(16, 2) = "H"
    SoftStrategy(16, 3) = "H"
    SoftStrategy(16, 4) = "DH"
    SoftStrategy(16, 5) = "DH"
    SoftStrategy(16, 6) = "DH"
    SoftStrategy(16, 7) = "H"
    SoftStrategy(16, 8) = "H"
    SoftStrategy(16, 9) = "H"
    SoftStrategy(16, 10) = "H"
    SoftStrategy(16, 1) = "H" 
    SoftStrategy(17, 2) = "H"
    SoftStrategy(17, 3) = "DH"
    SoftStrategy(17, 4) = "DH"
    SoftStrategy(17, 5) = "DH"
    SoftStrategy(17, 6) = "DH"
    SoftStrategy(17, 7) = "H"
    SoftStrategy(17, 8) = "H"
    SoftStrategy(17, 9) = "H"
    SoftStrategy(17, 10) = "H"
    SoftStrategy(17, 1) = "H" 
    SoftStrategy(18, 2) = "DS"
    SoftStrategy(18, 3) = "DS"
    SoftStrategy(18, 4) = "DS"
    SoftStrategy(18, 5) = "DS"
    SoftStrategy(18, 6) = "DS"
    SoftStrategy(18, 7) = "S"
    SoftStrategy(18, 8) = "S"
    SoftStrategy(18, 9) = "H"
    SoftStrategy(18, 10) = "H"
    SoftStrategy(18, 1) = "H" 
    SoftStrategy(19, 2) = "S"
    SoftStrategy(19, 3) = "S"
    SoftStrategy(19, 4) = "S"
    SoftStrategy(19, 5) = "S"
    SoftStrategy(19, 6) = "DS"
    SoftStrategy(19, 7) = "S"
    SoftStrategy(19, 8) = "S"
    SoftStrategy(19, 9) = "S"
    SoftStrategy(19, 10) = "S"
    SoftStrategy(19, 1) = "S" 
    SoftStrategy(20, 2) = "S"
    SoftStrategy(20, 3) = "S"
    SoftStrategy(20, 4) = "S"
    SoftStrategy(20, 5) = "S"
    SoftStrategy(20, 6) = "S"
    SoftStrategy(20, 7) = "S"
    SoftStrategy(20, 8) = "S"
    SoftStrategy(20, 9) = "S"
    SoftStrategy(20, 10) = "S"
    SoftStrategy(20, 1) = "S" 
    SoftStrategy(21, 2) = "S"
    SoftStrategy(21, 3) = "S"
    SoftStrategy(21, 4) = "S"
    SoftStrategy(21, 5) = "S"
    SoftStrategy(21, 6) = "S"
    SoftStrategy(21, 7) = "S"
    SoftStrategy(21, 8) = "S"
    SoftStrategy(21, 9) = "S"
    SoftStrategy(21, 10) = "S"
    SoftStrategy(21, 1) = "S" 
    SplitStrategy(2, 2) = "H"
    SplitStrategy(2, 3) = "H"
    SplitStrategy(2, 4) = "P"
    SplitStrategy(2, 5) = "P"
    SplitStrategy(2, 6) = "P"
    SplitStrategy(2, 7) = "P"
    SplitStrategy(2, 8) = "H"
    SplitStrategy(2, 9) = "H"
    SplitStrategy(2, 10) = "H"
    SplitStrategy(2, 1) = "H" 
    SplitStrategy(3, 2) = "H"
    SplitStrategy(3, 3) = "H"
    SplitStrategy(3, 4) = "P"
    SplitStrategy(3, 5) = "P"
    SplitStrategy(3, 6) = "P"
    SplitStrategy(3, 7) = "P"
    SplitStrategy(3, 8) = "H"
    SplitStrategy(3, 9) = "H"
    SplitStrategy(3, 10) = "H"
    SplitStrategy(3, 1) = "H" 
    SplitStrategy(4, 2) = "H"
    SplitStrategy(4, 3) = "H"
    SplitStrategy(4, 4) = "H"
    SplitStrategy(4, 5) = "H"
    SplitStrategy(4, 6) = "H"
    SplitStrategy(4, 7) = "H"
    SplitStrategy(4, 8) = "H"
    SplitStrategy(4, 9) = "H"
    SplitStrategy(4, 10) = "H"
    SplitStrategy(4, 1) = "H" 
    SplitStrategy(5, 2) = "DH"
    SplitStrategy(5, 3) = "DH"
    SplitStrategy(5, 4) = "DH"
    SplitStrategy(5, 5) = "DH"
    SplitStrategy(5, 6) = "DH"
    SplitStrategy(5, 7) = "DH"
    SplitStrategy(5, 8) = "DH"
    SplitStrategy(5, 9) = "DH"
    SplitStrategy(5, 10) = "H"
    SplitStrategy(5, 1) = "H" 
    SplitStrategy(6, 2) = "P"
    SplitStrategy(6, 3) = "P"
    SplitStrategy(6, 4) = "P"
    SplitStrategy(6, 5) = "P"
    SplitStrategy(6, 6) = "P"
    SplitStrategy(6, 7) = "H"
    SplitStrategy(6, 8) = "H"
    SplitStrategy(6, 9) = "H"
    SplitStrategy(6, 10) = "H"
    SplitStrategy(6, 1) = "H" 
    SplitStrategy(7, 2) = "P"
    SplitStrategy(7, 3) = "P"
    SplitStrategy(7, 4) = "P"
    SplitStrategy(7, 5) = "P"
    SplitStrategy(7, 6) = "P"
    SplitStrategy(7, 7) = "P"
    SplitStrategy(7, 8) = "H"
    SplitStrategy(7, 9) = "H"
    SplitStrategy(7, 10) = "H"
    SplitStrategy(7, 1) = "H" 
    SplitStrategy(8, 2) = "P"
    SplitStrategy(8, 3) = "P"
    SplitStrategy(8, 4) = "P"
    SplitStrategy(8, 5) = "P"
    SplitStrategy(8, 6) = "P"
    SplitStrategy(8, 7) = "P"
    SplitStrategy(8, 8) = "P"
    SplitStrategy(8, 9) = "P"
    SplitStrategy(8, 10) = "P"
    SplitStrategy(8, 1) = "RP" 
    SplitStrategy(9, 2) = "P"
    SplitStrategy(9, 3) = "P"
    SplitStrategy(9, 4) = "P"
    SplitStrategy(9, 5) = "P"
    SplitStrategy(9, 6) = "P"
    SplitStrategy(9, 7) = "S"
    SplitStrategy(9, 8) = "P"
    SplitStrategy(9, 9) = "P"
    SplitStrategy(9, 10) = "S"
    SplitStrategy(9, 1) = "S" 
    SplitStrategy(10, 2) = "S"
    SplitStrategy(10, 3) = "S"
    SplitStrategy(10, 4) = "S"
    SplitStrategy(10, 5) = "S"
    SplitStrategy(10, 6) = "S"
    SplitStrategy(10, 7) = "S"
    SplitStrategy(10, 8) = "S"
    SplitStrategy(10, 9) = "S"
    SplitStrategy(10, 10) = "S"
    SplitStrategy(10, 1) = "S" 
    SplitStrategy(1, 2) = "P"
    SplitStrategy(1, 3) = "P"
    SplitStrategy(1, 4) = "P"
    SplitStrategy(1, 5) = "P"
    SplitStrategy(1, 6) = "P"
    SplitStrategy(1, 7) = "P"
    SplitStrategy(1, 8) = "P"
    SplitStrategy(1, 9) = "P"
    SplitStrategy(1, 10) = "P"
    SplitStrategy(1, 1) = "P"
End Sub

From: https://bytes.com/topic/access/insights/959297-fun-blackjack-simulator

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/cxygs5788/article/details/107256165

智能推荐

使用nginx解决浏览器跨域问题_nginx不停的xhr-程序员宅基地

文章浏览阅读1k次。通过使用ajax方法跨域请求是浏览器所不允许的,浏览器出于安全考虑是禁止的。警告信息如下:不过jQuery对跨域问题也有解决方案,使用jsonp的方式解决,方法如下:$.ajax({ async:false, url: 'http://www.mysite.com/demo.do', // 跨域URL ty..._nginx不停的xhr

在 Oracle 中配置 extproc 以访问 ST_Geometry-程序员宅基地

文章浏览阅读2k次。关于在 Oracle 中配置 extproc 以访问 ST_Geometry,也就是我们所说的 使用空间SQL 的方法,官方文档链接如下。http://desktop.arcgis.com/zh-cn/arcmap/latest/manage-data/gdbs-in-oracle/configure-oracle-extproc.htm其实简单总结一下,主要就分为以下几个步骤。..._extproc

Linux C++ gbk转为utf-8_linux c++ gbk->utf8-程序员宅基地

文章浏览阅读1.5w次。linux下没有上面的两个函数,需要使用函数 mbstowcs和wcstombsmbstowcs将多字节编码转换为宽字节编码wcstombs将宽字节编码转换为多字节编码这两个函数,转换过程中受到系统编码类型的影响,需要通过设置来设定转换前和转换后的编码类型。通过函数setlocale进行系统编码的设置。linux下输入命名locale -a查看系统支持的编码_linux c++ gbk->utf8

IMP-00009: 导出文件异常结束-程序员宅基地

文章浏览阅读750次。今天准备从生产库向测试库进行数据导入,结果在imp导入的时候遇到“ IMP-00009:导出文件异常结束” 错误,google一下,发现可能有如下原因导致imp的数据太大,没有写buffer和commit两个数据库字符集不同从低版本exp的dmp文件,向高版本imp导出的dmp文件出错传输dmp文件时,文件损坏解决办法:imp时指定..._imp-00009导出文件异常结束

python程序员需要深入掌握的技能_Python用数据说明程序员需要掌握的技能-程序员宅基地

文章浏览阅读143次。当下是一个大数据的时代,各个行业都离不开数据的支持。因此,网络爬虫就应运而生。网络爬虫当下最为火热的是Python,Python开发爬虫相对简单,而且功能库相当完善,力压众多开发语言。本次教程我们爬取前程无忧的招聘信息来分析Python程序员需要掌握那些编程技术。首先在谷歌浏览器打开前程无忧的首页,按F12打开浏览器的开发者工具。浏览器开发者工具是用于捕捉网站的请求信息,通过分析请求信息可以了解请..._初级python程序员能力要求

Spring @Service生成bean名称的规则(当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致)_@service beanname-程序员宅基地

文章浏览阅读7.6k次,点赞2次,收藏6次。@Service标注的bean,类名:ABDemoService查看源码后发现,原来是经过一个特殊处理:当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致public class AnnotationBeanNameGenerator implements BeanNameGenerator { private static final String C..._@service beanname

随便推点

二叉树的各种创建方法_二叉树的建立-程序员宅基地

文章浏览阅读6.9w次,点赞73次,收藏463次。1.前序创建#include&lt;stdio.h&gt;#include&lt;string.h&gt;#include&lt;stdlib.h&gt;#include&lt;malloc.h&gt;#include&lt;iostream&gt;#include&lt;stack&gt;#include&lt;queue&gt;using namespace std;typed_二叉树的建立

解决asp.net导出excel时中文文件名乱码_asp.net utf8 导出中文字符乱码-程序员宅基地

文章浏览阅读7.1k次。在Asp.net上使用Excel导出功能,如果文件名出现中文,便会以乱码视之。 解决方法: fileName = HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8);_asp.net utf8 导出中文字符乱码

笔记-编译原理-实验一-词法分析器设计_对pl/0作以下修改扩充。增加单词-程序员宅基地

文章浏览阅读2.1k次,点赞4次,收藏23次。第一次实验 词法分析实验报告设计思想词法分析的主要任务是根据文法的词汇表以及对应约定的编码进行一定的识别,找出文件中所有的合法的单词,并给出一定的信息作为最后的结果,用于后续语法分析程序的使用;本实验针对 PL/0 语言 的文法、词汇表编写一个词法分析程序,对于每个单词根据词汇表输出: (单词种类, 单词的值) 二元对。词汇表:种别编码单词符号助记符0beginb..._对pl/0作以下修改扩充。增加单词

android adb shell 权限,android adb shell权限被拒绝-程序员宅基地

文章浏览阅读773次。我在使用adb.exe时遇到了麻烦.我想使用与bash相同的adb.exe shell提示符,所以我决定更改默认的bash二进制文件(当然二进制文件是交叉编译的,一切都很完美)更改bash二进制文件遵循以下顺序> adb remount> adb push bash / system / bin /> adb shell> cd / system / bin> chm..._adb shell mv 权限

投影仪-相机标定_相机-投影仪标定-程序员宅基地

文章浏览阅读6.8k次,点赞12次,收藏125次。1. 单目相机标定引言相机标定已经研究多年,标定的算法可以分为基于摄影测量的标定和自标定。其中,应用最为广泛的还是张正友标定法。这是一种简单灵活、高鲁棒性、低成本的相机标定算法。仅需要一台相机和一块平面标定板构建相机标定系统,在标定过程中,相机拍摄多个角度下(至少两个角度,推荐10~20个角度)的标定板图像(相机和标定板都可以移动),即可对相机的内外参数进行标定。下面介绍张氏标定法(以下也这么称呼)的原理。原理相机模型和单应矩阵相机标定,就是对相机的内外参数进行计算的过程,从而得到物体到图像的投影_相机-投影仪标定

Wayland架构、渲染、硬件支持-程序员宅基地

文章浏览阅读2.2k次。文章目录Wayland 架构Wayland 渲染Wayland的 硬件支持简 述: 翻译一篇关于和 wayland 有关的技术文章, 其英文标题为Wayland Architecture .Wayland 架构若是想要更好的理解 Wayland 架构及其与 X (X11 or X Window System) 结构;一种很好的方法是将事件从输入设备就开始跟踪, 查看期间所有的屏幕上出现的变化。这就是我们现在对 X 的理解。 内核是从一个输入设备中获取一个事件,并通过 evdev 输入_wayland

推荐文章

热门文章

相关标签