Class Paranoid

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

public final class Paranoid extends Object implements BotStrategy
Implements a "paranoid" bot strategy for a game. The bot tries to maximize its own score while minimizing the opponent's score. The strategy uses a recursive minimax algorithm to evaluate the best move for the current game state. The bot will choose the move that results in the highest score for itself, assuming the opponent will make the move that results in the lowest score for the bot.
  • Constructor Details

    • Paranoid

      public Paranoid(GameState initialState)
      Constructs a new Paranoid bot strategy with the given initial game state.
      Parameters:
      initialState - the initial game state for the bot to analyze
    • Paranoid

      public Paranoid(GameState initialState, BotStrategyConfig config)
      Constructs a new Paranoid bot strategy with the given initial game state and configuration.
      Parameters:
      initialState - the initial game state for the bot to analyze
      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