Class MaxN

java.lang.Object
org.xxdc.oss.example.bot.MaxN
All Implemented Interfaces:
BotStrategy

public final class MaxN extends Object implements BotStrategy
Implements the MaxN bot strategy for a game. The MaxN strategy tries to maximize the score for the current player, while considering the scores of all other players. It uses a recursive algorithm to explore the game tree and find the best move.
  • Constructor Details

    • MaxN

      public MaxN(GameState initialState)
      Constructs a new MaxN bot strategy with the given initial game state and default configuration.
      Parameters:
      initialState - the initial game state to use for the bot strategy
    • MaxN

      public MaxN(GameState initialState, BotStrategyConfig config)
      Constructs a new MaxN bot strategy with the given initial game state and configuration.
      Parameters:
      initialState - the initial game state to use for the bot strategy
      config - the configuration settings for the bot strategy
  • Method Details

    • bestMove

      public int bestMove()
      Description copied from interface: BotStrategy
      Returns the best move for the current game state.
      Specified by:
      bestMove in interface BotStrategy
      Returns:
      the index of the best move to make