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 GAMENOTIMPLEMENTED
"Game not yet implemented.";
Construct a new instance of RPS with the given possible moves.
@param moves all possible moves in the game.
public RPSString moves
this.possibleMoves moves;
this.playerMoves new StringMAXGAMES;
this.cpuMoves new StringMAXGAMES;
public static void mainString args
If command line args are provided use those as the possible moves
String moves new Stringargslength;
if argslength MINPOSSIBLEMOVES
System.arraycopyargs moves, args.length;
else
moves RPSDEFAULTMOVES;
Create new game and scanner
RPS game new RPSmoves;
Scanner in new ScannerSystemin;
While user does not input q play game
System.out.printlnGAMENOTIMPLEMENTED; remove this
TODO: Insert the code to play the game.
See the writeup for an example of the game play.
Hint: call the methods weyou have already written
to do most of the work! And don't forget Javadoc.
inclose;
@Override
public int determineWinnerString playerMove, String cpuMove
TODO
return ; 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
