Commit 450f6cfc authored by mva021's avatar mva021
Browse files

Added comments to AI

parent ac674ab4
......@@ -2,6 +2,24 @@ package;
import inf101.v20.sem2.grid.Location;
* This AI is based on an algorithm that is not curriculum for INF101, but maybe for INF102.
* Since many of the students had tried implementing such an AI I have included one in this solution.
* But such a level of AI is not expected at the level of INF101.
* This player uses a minimax strategy to search for the best move.
* That means that it tries all possible moves and gives a score to each move.
* The score is given by calling the method recursively for the other player to
* make the move that is best for him.
* We assume that what is best for you is worst for your opponent,
* otherwise this strategy will not work.
* In this case we give score 1 for win, score for draw and score -1 for loosing.
* Note that the sum of the scores for both players always is 0.
* @author mva021
public class MiniMaxPlayer extends AbstractPlayer {
int depth; //defines how many steps ahead the search should continue;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment