Browse Source

add nextMove method

testing_N
Alina Ehrensberger 1 year ago
parent
commit
d61cff8eeb
1 changed files with 22 additions and 4 deletions
  1. 22
    4
      src/ManualBot.java

+ 22
- 4
src/ManualBot.java View File

@@ -1,4 +1,4 @@
import java.util.Scanner;
public class ManualBot extends Bot{
public static void main(String[] args) {
Bot manualBot = new ManualBot(args);
@@ -9,9 +9,27 @@ public class ManualBot extends Bot{
}

protected char nextMove(View view) throws Exception{
Scanner scanner = new Scanner();
scanner.
Scanner scanner = new Scanner(System.in);
switch(scanner.nextLine()){
case "w":
return '^' ;
break;
case "s":
return 'V' ;
break;
case "a":
return '<' ;
break;
case "d":
return '>' ;
break;
case "q":
throw new Exception;
break;
default:
break;
}


return c;
}
}

Loading…
Cancel
Save