Sample code - multiple bots
'---VB.Net
Dim pass, dealer, current_bid, k, j, n, new_bid, position, vulnerability As Integer
Dim meaning As String
Dim info() As Integer
'---structure hand must be previously declared as:
'Private Structure TYPE_HAND
' Dim suit() As String
'End Structure
Dim hand() As TYPE_HAND
'---reference must be previously set to EPBot64.EPBot or EPBot86.EPBot
Dim Player() As EPBot64.EPBot 'or EPBot86.EPBot
Const C_PASS As Integer = 0
Const C_DOUBLE As Integer = 1
Const C_REDOUBLE As Integer = 2
Const C_CLUBS As Integer = 0
Const C_DIAMONDS As Integer = 1
Const C_HEARTS As Integer = 2
Const C_SPADES As Integer = 3
Const C_NT As Integer = 4
Const C_NS As Integer = 0
Const C_WE As Integer = 1
Const C_MP As Integer = 0
Const C_IMP As Integer = 1
Const T_21GF As Integer = 0
Const T_SAYC As Integer = 1
Const T_WJ As Integer = 2
Const T_PC As Integer = 3
Const MAX_TABLE As Integer = 399
ReDim Player(4 * MAX_TABLE + 3)
For k = 0 To 4 * MAX_TABLE + 3
Player(k) = New EPBot64.EPBot
Next k
ReDim hand(3)
For k = 0 To 3
ReDim hand(k).suit(3)
Next
hand(0).suit(C_CLUBS) = "987"
hand(0).suit(C_DIAMONDS) = "KQJT7"
hand(0).suit(C_HEARTS) = "A74"
hand(0).suit(C_SPADES) = "A6"
hand(1).suit(C_CLUBS) = "T652"
hand(1).suit(C_DIAMONDS) = "3"
hand(1).suit(C_HEARTS) = "QJ82"
hand(1).suit(C_SPADES) = "J732"
hand(2).suit(C_CLUBS) = "J3"
hand(2).suit(C_DIAMONDS) = "A9842"
hand(2).suit(C_HEARTS) = "K3"
hand(2).suit(C_SPADES) = "T984"
hand(3).suit(C_CLUBS) = "AKQ4"
hand(3).suit(C_DIAMONDS) = "65"
hand(3).suit(C_HEARTS) = "T965"
hand(3).suit(C_SPADES) = "KQ5"
dealer = 2
vulnerability = 1
For n = 0 To MAX_TABLE
For position = 0 To 3
'---prepare new hand on the table
Player(4 * n + position).scoring = C_MP
Player(4 * n + position).system_type(C_NS) = T_WJ
Player(4 * n + position).system_type(C_WE) = T_21GF
Player(4 * n + position).new_hand(position, hand(position).suit, dealer, vulnerability)
Next position
pass = 0
new_bid = 0
current_bid = 0
k = 4 * n + dealer
Do
position = k Mod 4
new_bid = Player(k).get_bid
If new_bid = C_PAS Then
pass = pass + 1
Else
pass = 0
If new_bid > C_REDOUBLE Then
current_bid = new_bid
End If
End If
For j = 4 * n To 4 * n + 3
Player(j).set_bid(position, new_bid)
Next j
With Player(k)
'---get info from Player(k) about k player
meaning = .info_meaning(position)
'---arrays
info = .info_feature(position)
info = .info_honors(position)
info = .info_max_length(position)
info = .info_min_length(position)
info = .info_probable_length(position)
info = .info_suit_power(position)
'---to mannually correct info-----
'info(C_HEARTS) = 3
'.info_suit_power(position) = info
'--------------------------------------
info = .info_stoppers(position)
End With
'---set a new player
k = 4 * n + (k + 1) Mod 4
Loop While (pass < 3 Or pass < 4 And current_bid = 0)
Next n