add nextMove method
This commit is contained in:
parent
e80d23de53
commit
d61cff8eeb
@ -1,4 +1,4 @@
|
|||||||
|
import java.util.Scanner;
|
||||||
public class ManualBot extends Bot{
|
public class ManualBot extends Bot{
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Bot manualBot = new ManualBot(args);
|
Bot manualBot = new ManualBot(args);
|
||||||
@ -9,9 +9,27 @@ public class ManualBot extends Bot{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected char nextMove(View view) throws Exception{
|
protected char nextMove(View view) throws Exception{
|
||||||
Scanner scanner = new Scanner();
|
Scanner scanner = new Scanner(System.in);
|
||||||
scanner.
|
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…
x
Reference in New Issue
Block a user