Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package nl.tue.s2id90.groupNN.samples;
  2.  
  3.  
  4. import java.util.List;
  5. import nl.tue.s2id90.draughts.DraughtsState;
  6. import nl.tue.s2id90.draughts.player.DraughtsPlayer;
  7. import org10x10.dam.game.Move;
  8.  
  9. /**
  10.  * A simple draughts player that plays the first moves that comes to mind
  11.  * and values all moves with value 0.
  12.  * @author huub
  13.  */
  14. public class OptimisticPlayer extends DraughtsPlayer {
  15.  
  16.     public OptimisticPlayer() {
  17.         super(UninformedPlayer.class.getResource("optimist.png"));
  18.     }
  19.     @Override
  20.     /** @return a random move **/
  21.     public Move getMove(DraughtsState s) {
  22.         List<Move> moves = s.getMoves();
  23.         return moves.get(0);
  24.     }
  25.    
  26.     @Override
  27.     public Integer getValue() {
  28.         return 0;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement