package tictactoe.GameMechanics;

import java.util.Random;

public enum Player {
    X("X"),
    O("O"),
    Neither("_");

    private String displayString;

    Player(String displayString) {
        this.displayString = displayString;
    }

    public String getDisplayString() {
        return this.displayString;
    }

    public static Player getRandomPlayer() {
        Random r = new Random(System.currentTimeMillis());
        boolean playerIsX = r.nextBoolean();
        return playerIsX ? Player.X : Player.O;
    }
}

@@ -150,16 +150,241 @@
 yString;
+%0A    /* initialize Random once as a static field to avoid super fast execution%0A       resulting in the same millisecond value used for several seeds. */%0A    private static Random rand = new Random(System.currentTimeMillis());
 %0A%0A    Pl
@@ -601,56 +601,45 @@
     
-Random r = new Random(System.currentTimeMillis()
+boolean playerIsX = rand.nextBoolean(
 );%0A 
@@ -637,38 +637,37 @@
 lean();%0A        
-boolea
+retur
 n playerIsX = r.
@@ -666,74 +666,219 @@
 IsX 
-= r.nextBoolean()
+? Player.X : Player.O
 ;%0A    
+%7D%0A%0A
     
-return playerIsX ? Player.X : Player.O;
+public static Player getOtherPlayer(Player player1) %7B%0A        if(player1.equals(Player.X)) %7B%0A            return Player.O;%0A        %7D else %7B%0A            return Player.X;%0A        %7D
 %0A   

add logic for swapping players