Advertisement
jsbsan

evalua

Oct 4th, 2013
3,292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.62 KB | None | 0 0
  1. Public Sub EvaluaJugadaMov(tablero As ClassTablero, jugador As Integer) As Integer
  2.  
  3.   Dim valor_jugada, valor As Integer
  4.   Dim n2, n3, n4 As Integer
  5.   Dim j2, j3, j4 As Integer
  6.   Dim eva As Integer[]
  7.  
  8.   eva = tablero.comprueba_linea(4, jugador)
  9.   n4 = eva[1]
  10.   j4 = eva[0]
  11.  
  12.   If n4 = 0 Then
  13.     'mejora de rendimiento  (version 0.0.4),
  14.     eva = tablero.comprueba_linea(2, jugador)
  15.     n2 = eva[1]
  16.     j2 = eva[0]
  17.    
  18.     eva = tablero.comprueba_linea(3, jugador)
  19.     n3 = eva[1]
  20.     j3 = eva[0]
  21.    
  22.   Endif
  23.  
  24.   valor_jugada = (4 * n2 + 9 * n3 + 100000 * n4)
  25.  
  26.   Return valor_jugada
  27.  
  28. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement