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.

EscapeBot.java 901B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package Praktikum05;
  2. import java.util.Random;
  3. public class EscapeBot extends Bot{
  4. protected EscapeBot(String args[]){
  5. super(args);
  6. }
  7. private Random schritte = new Random();
  8. private int s = 5;
  9. @Override
  10. protected char nextMove(View view) throws Exception {
  11. boolean exit = false;
  12. while(!exit){
  13. /*if(view.data.contains("o")){
  14. }*/
  15. if(s == 5){
  16. for(int i = 1; i == s; i++ ){
  17. return '^';
  18. }
  19. boolean turn = schritte.nextBoolean();
  20. if(turn == true){
  21. return '<';
  22. }else{
  23. return '>';
  24. }
  25. }
  26. }
  27. throw new Exception("Quit");
  28. }
  29. public static void main(String args[]){
  30. Bot ebot = new EscapeBot(args);
  31. ebot.run();
  32. }
  33. }