-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathPlayerExample.java
More file actions
39 lines (37 loc) · 1.11 KB
/
PlayerExample.java
File metadata and controls
39 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.*;
/**
* Each player or team will create their own Player, this is only an example....
*
* Your code MUST INCLUDE a move method with the following signature. To insure that, you must implement
* the Player interface
*
* You can create additional methods but must have the move method
*
*/
public class PlayerExample implements Player
{
private static String name = "PlayerExample";
/**
* An example of a method - replace this comment with your own
* You must create some kind of logic of what to play against your opponent...start thinking!
*
* @return the move you want to play against opponent
* "r" - rock
* "p" - paper
* "s" - scissors
* anything else - forfeit the turn
*/
public String move(String [] myMoves, String [] opponentMoves, int myScore, int opponentScore)
{
return " ";
}
/**
* Returns the name of the player
*
* @return the name of the player
*/
public String getName()
{
return name;
}
}