Lab

Chess Mind

AINTECH · Motor adversarial Minimax α-β

Motor de búsqueda adversarial con poda α-β. Explora el árbol de juego en profundidad configurable, evalúa posiciones con heurísticas posicionales (esquinas, movilidad) y elige el movimiento óptimo. Juega Reversi 6×6 contra el motor. Eres negro.

2
2
Tu turno — negro
1 (rápido)6 (perfecto)

Pseudocódigo Minimax

function minimax(board, depth, α, β, max):
  if depth == 0: return evaluate(board)
  moves = getLegalMoves(board)
  if max:
    v = -∞
    for move in moves:
      v = max(v, minimax(play(move), depth-1, α, β, false))
      α = max(α, v)
      if β ≤ α: break  // α-β pruning
    return v
  else: ...

Función heurística

  • Esquinas: ×4 (decisivas)
  • Fichas propias: +1 · fichas enemigas: -1
  • Poda α-β reduce ramas ~70%
  • Profundidad 4 → ~2000 nodos