Advertisement
SuperJedi224

RandomBot

Apr 11th, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. public class RandomBot extends Bot{
  4.     public RandomBot(){
  5.         this.name="RandomBot";
  6.     }
  7.     @Override
  8.     public Action action(int[][] map) {
  9.         return new Action[]{Action.UP,Action.DOWN,Action.LEFT,Action.RIGHT,Action.PASS}[(new Random()).nextInt(5)];
  10.     }
  11.    
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement