subject
Computers and Technology, 03.12.2020 18:30 nerd58

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!");
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
You know the right answer?
Code works, just need help adding the method header /**
* TODO -- Add in method header commen...
Questions
Questions on the website: 13722363