1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package Praktikum05;
-
- import java.util.Random;
- import java.util.Scanner;
-
- public class RumbleBot extends Bot {
- protected RumbleBot(String[] args) {
- super(args);
- }
-
- private Scanner input = new Scanner(System.in);
- private int counter = 0;
- private Random leftOrRight = new Random();
- @Override
- protected char nextMove(View view) throws Exception {
- char roverKennung = view.data.charAt(40);
- boolean exit = false;
- while (!exit) {
-
- if(counter <= 8){
- counter++;
- return '^';
- }else if(counter > 8){
- counter = 0;
- if(leftOrRight.nextBoolean()){
- return '>';
- }else{
- return '<';
- }
- }
-
- }
- throw new Exception("Beendet");
- }
-
-
-
- public static void main(String args[]){
- Bot bot = new RumbleBot(args);
- bot.run();
- }
-
-
- }
|