Advertisement
jsbsan

clase jugador ordenador

Oct 4th, 2013
1,338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.84 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Inherits ClassJugador
  4.  
  5. Public Function juega(tablero As ClassTablero, ProducidoClick As Boolean[], col As Integer[], TextLabelmensajes As TextLabel, area As TextArea) As ClassTablero
  6.  
  7.   Dim devolucion As New Variant[]
  8.   Dim tablerotmp As ClassTablero
  9.   Dim jugada As Integer
  10.   Dim colorJugador As New Collection
  11.   Dim profundidadArbol As Integer[] = [3, 4, 5, 6]
  12.  
  13.   colorJugador.Add("Amarillo", "-1")
  14.   colorJugador.Add("Naranja", "1")
  15.  
  16.   tablerotmp = tablero.copia()
  17.   devolucion = ia.negamax(tablerotmp, Super.numero, profundidadArbol[Super.profundidad - 1], - main.maximoInteger - 1, main.maximoInteger)
  18.   jugada = devolucion[1]
  19.   area.Text &= gb.CrLf & "Jugador: " & colorJugador[Str$(Super.numero)] & ", columna: " & Str$(jugada + 1)
  20.   tablero.insertaficha(jugada, Super.numero)
  21.   Return tablero
  22.  
  23. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement