Class Paranoid
java.lang.Object
org.xxdc.oss.example.bot.Paranoid
- All Implemented Interfaces:
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.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new Paranoid bot strategy with the given initial game state.Paranoid(GameState initialState, BotStrategyConfig config) Constructs a new Paranoid bot strategy with the given initial game state and configuration. -
Method Summary
Modifier and TypeMethodDescriptionintbestMove()Returns the best move for the current game state.
-
Constructor Details
-
Paranoid
Constructs a new Paranoid bot strategy with the given initial game state.- Parameters:
initialState- the initial game state for the bot to analyze
-
Paranoid
Constructs a new Paranoid bot strategy with the given initial game state and configuration.- Parameters:
initialState- the initial game state for the bot to analyzeconfig- the configuration settings for the bot strategy
-
-
Method Details
-
bestMove
public int bestMove()Description copied from interface:BotStrategyReturns the best move for the current game state.- Specified by:
bestMovein interfaceBotStrategy- Returns:
- the index of the best move to make
-