Question: import java.util.Scanner; public class RPS extends RPSAbstract { / / Messages for the game. protected static final String GAME _ NOT _ IMPLEMENTED = Game

import java.util.Scanner;
public class RPS extends RPSAbstract {
// Messages for the game.
protected static final String GAME_NOT_IMPLEMENTED =
"Game not yet implemented.";
/**
* Construct a new instance of RPS with the given possible moves.
*
* @param moves all possible moves in the game.
*/
public RPS(String[] moves){
this.possibleMoves = moves;
this.playerMoves = new String[MAX_GAMES];
this.cpuMoves = new String[MAX_GAMES];
}
public static void main(String[] args){
// If command line args are provided use those as the possible moves
String[] moves = new String[args.length];
if (args.length >= MIN_POSSIBLE_MOVES){
System.arraycopy(args,0, moves, 0, args.length);
} else {
moves = RPS.DEFAULT_MOVES;
}
// Create new game and scanner
RPS game = new RPS(moves);
Scanner in = new Scanner(System.in);
// While user does not input "q", play game
System.out.println(GAME_NOT_IMPLEMENTED); // remove this
// TODO: Insert the code to play the game.
// See the writeup for an example of the game play.
// Hint: call the methods we/you have already written
// to do most of the work! And don't forget Javadoc.
in.close();
}
@Override
public int determineWinner(String playerMove, String cpuMove){
// TODO
return 0; // replace this when you implement the method
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!