Professional Documents
Culture Documents
Alp A A
Alp A A
node As Node, ByVal depth As Integer, ByVal al pha As Integer, ByVal beta As Integer, ByVal Player As Boolean) As Integer If depth = 0 Or node.IsTerminal(Player) Then Return node.GetTotalScore(Player) End If If Player = MaxPlayer Then Dim child As Node For Each child In node.Children(Player) alpha = Math.Max(alpha, Iterate(child, depth - 1, alpha, beta, N ot Player)) If beta < alpha Then Exit For End If Next Return alpha Else Dim child As Node For Each child In node.Children(Player) beta = Math.Min(beta, Iterate(child, depth - 1, alpha, beta, Not Player)) If beta < alpha Then Exit For End If Next Return beta End If End Function End Class '---------------------------------------------------------------' Converted from C# to VB .NET using CSharpToVBConverter(1.2). ' Developed by: Kamal Patel (http://www.KamalPatel.net) '----------------------------------------------------------------