code works, just need help adding the method header
/**
* TODO -- Add in method header comments. Make sure that your algorithmic comments are clear and comprehensive.
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int numPlayers = 2;
boolean testMode = false;
boolean seedInput = false;
long seed = 0;
argState cmdFlag = argState.NONE;
for(String arg: args) {
switch(arg) {
case "-t":
cmdFlag = argState.TEST;
break;
case "-p":
cmdFlag = argState.PLAYERS;
break;
default:
if(cmdFlag == argState.TEST) {
seed = Long.parseLong(arg);
seedInput = true;
} else if(cmdFlag == argState.PLAYERS) {
numPlayers = Integer.parseInt(arg);
}
cmdFlag = argState.NONE;
break;
}
}
Random rand;
if(seedInput) {
rand = new Random(seed);
} else {
rand = new Random();
}
int[] players = new int[]{COMPUTER_PLAYER, COMPUTER_PLAYER};
for(int i = 0; i BOARD_WIDTH || board[BOARD_HEIGHT - 1][move - 1] != -1) {
System.out.println("Invalid column: " + move + ". Please select a (non-full) column from 1 to " +
BOARD_WIDTH + ".");
continue;
}
gameOn = !isWinningCol(move - 1, board, player);
dropToken(move - 1, board, player);
} else {
gameOn = !comp(board, player, rand);
}
pgb(board);
if(!gameOn) {
System.out.println("Player " + (player + 1) + " won!");
}
player = (player + 1) % 2;
if(gameOn && checkFullBoard(board)) {
System.out.println("Game over. We have a draw!");
gameOn = false;
}
}
System.out.println("Thank you for playing!");
}