You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
353 B
16 lines
353 B
5 years ago
|
package model;
|
||
|
|
||
|
/**
|
||
|
* The class implements a random strategy for connect4 game.
|
||
|
*/
|
||
|
|
||
|
import model.Connect4Model;
|
||
|
import java.util.Random;
|
||
|
|
||
|
public class RandomAI implements ComputerPlayer {
|
||
|
public int getMove(Connect4Model gameModel, boolean max) {
|
||
|
Random randomGenerator = new Random();
|
||
|
return randomGenerator.nextInt(gameModel.getMaxRow());
|
||
|
}
|
||
|
}
|