Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void run(GameOfCluedo game, ArrayList<Player> players){
- int turn = 1;
- Random dice = new Random();
- while (1 == 1) { // loop forever
- System.out.println("\n********************");
- System.out.println("***** TURN " + turn + " *******");
- System.out.println("********************\n");
- boolean firstTime = true;
- for (Player player : players) {
- if (!firstTime) {
- System.out.println("\n********************\n");
- }
- firstTime = false;
- int roll = dice.nextInt(5) + 1;
- System.out.println(player.getName() + " rolls a " + roll + ".");
- String toParse = inputString("You are eligible to move "
- + roll + " spaces. \n"
- + "Use WASD to move and please enter this format 'w2' to move North two spaces."
- + "/nyou can also press 'z' to make a suggestion or 'x' to make an accusation.");
- char[] arr = toParse.toCharArray();
- if (arr.length == 1){
- if (arr[0] == 'z'){
- //do make an accusation
- } else if (arr[0] == 'x'){
- //do make a suggestion
- } else {
- System.out.println("You have entered an incorrect key!");
- }
- } else if (arr.length == 2){
- System.out.println(toParse);
- System.out.println(arr[1]);
- game.move(arr[0], arr[1], player);
- }
- game.getBoard().redraw();
- }
- turn++;
- }
- }
- private static boolean inputAccusation(){
- String actor = inputString("Please input an actor");
- String weapon = inputString("Please input a weapon");
- String room = inputString("Please input a room");
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement