This problem will be a fun application of interfaces. It revolves around the game of Rocks, Paper, Scissors (also known in some parts of the world as RoShamBo). For those of you who are not familiar with the game, it is played between two people who we will refer to as A and B. Person A makes a selection of either rock, scissor, or paper with person B being unaware of what A will choose. Similarly, person B will make a selection of either rock, scissor, or paper with person A being unaware of what B will choose. Then, based on the selection of each, a winner is decided based on the following selection matrix:
B selects ROCK B selects PAPER B selects SCISSOR
A selects ROCK TIE B WINS A WINS
A selects PAPER A WINS TIE B WINS
A selects SCISSOR B WINS A WINS TIE
This can be summarized as “rocks beat scissors” (since a rock can break a pair of scissors), “scissors beat paper” (since scissors can cut paper), and “paper beats rock” (since paper can cover a rock). Typically, the game is repeated many times so that players can exploit patterns in their opponents’ playing styles in order to accumulate more wins.
1. Consider the following interface:
import [login to view URL];
public interface RPS_Player {
/**
* integer constant representing the selection rock
*/
static final int ROCK = 0;
/**
* integer constant representing the selection scissor
*/
static final int PAPER = 1;
/**
* integer constant representing the selection paper
*/
static final int SCISSOR = 2;
/**
* method that utilizes an arraylist of an opponent’s previous choices to
* make a selection of whether to play rock, scissor, or paper next.
* @param prev an arraylist of previous selections made by the opponent
* the last entry of this list is the most recent move.
* @return the integer [login to view URL], [login to view URL], or
* [login to view URL]
*/
int makeSelection(ArrayList<Integer> prev);
/**
* method that returns name of the student who provided the
* implementation
* @return student's name as a string
*/
String getStudentName();
}
Please see the attached doc for more info.
I've gone through the document and can complete this work in 8 hours time(with the UML diagram). Message me and we can discuss more about the project.
Relevant Skills and Experience
I've implemented RPS on Java and have done UML diagrams in college.
Proposed Milestones
$33 USD - project milestone
$30 USD in 0 day
5.0 (25 reviews)
4.7
4.7
4 freelancers are bidding on average $26 USD for this job