|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package Prak1;
-
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.OutputStream;
- import java.net.Socket;
- import java.net.InetSocketAddress;
-
- public class battleBot extends Bot {
-
- private int steps = 1;
- private int counter = 0;
- private char lastCommand = '^';
-
- private int zuGehen = 1;
- private int gegangen = 0;
- boolean amDrehen = false;
- boolean amGehen = true;
- int x =0;
-
- public battleBot(String[] args) {
- super(args);
- }
-
- @Override
- protected char nextMove(View view) {
- char command;
- if(x<4){
- if(amGehen && gegangen < zuGehen){
- gegangen +=1;
- return '^';
- }else{
- x += 1;
- gegangen =0;
- return '>';
- }
- }
- else{
- x=0;
- zuGehen +=2;
- gegangen =0;
- return 'f';
- }
-
-
-
-
- }
-
- private char drehen() {
- return 'd';
- }
-
- private char gehen() {
- return 'w';
- }
-
- public static void main(String[] args) {
- new battleBot(args).run();
- }
- }
-
|