Class Random

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

public final class Random extends Object implements BotStrategy
Implements a bot strategy that makes random moves based on the available moves in the game state.
  • Constructor Details

    • Random

      public Random(GameState state)
      Constructs a new Random bot strategy instance with the given game state.
      Parameters:
      state - the current game state
  • 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