Compare commits
2
Commits
f67726a7cf
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
828a767003 | ||
|
|
7698381620 |
Binary file not shown.
@@ -1,21 +1,34 @@
|
|||||||
package Praktikum05;
|
package Praktikum05;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class RumbleBot extends Bot{
|
public class RumbleBot extends Bot {
|
||||||
protected RumbleBot(String[] args) {
|
protected RumbleBot(String[] args) {
|
||||||
super(args);
|
super(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Scanner input = new Scanner(System.in);
|
private Scanner input = new Scanner(System.in);
|
||||||
|
private int counter = 0;
|
||||||
|
private Random leftOrRight = new Random();
|
||||||
@Override
|
@Override
|
||||||
protected char nextMove(View view) throws Exception {
|
protected char nextMove(View view) throws Exception {
|
||||||
char roverKennung = view.data.charAt(40);
|
char roverKennung = view.data.charAt(40);
|
||||||
boolean exit = false;
|
boolean exit = false;
|
||||||
while (!exit) {
|
while (!exit) {
|
||||||
|
|
||||||
input.close();
|
if(counter <= 8){
|
||||||
|
counter++;
|
||||||
|
return '^';
|
||||||
|
}else if(counter > 8){
|
||||||
|
counter = 0;
|
||||||
|
if(leftOrRight.nextBoolean()){
|
||||||
|
return '>';
|
||||||
|
}else{
|
||||||
|
return '<';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
throw new Exception("Beendet");
|
throw new Exception("Beendet");
|
||||||
}
|
}
|
||||||
@@ -27,4 +40,5 @@ public class RumbleBot extends Bot{
|
|||||||
bot.run();
|
bot.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package Praktikum05;
|
package Praktikum05;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Scanner;
|
|
||||||
|
|
||||||
public class SnakeBot extends Bot {
|
public class SnakeBot extends Bot {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user