Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // To be implemented by all players
- interface Player {
- void reset();
- int move(int opponentLastMove, int xA, int xB, int xC);
- }
- // Player implementations
- class AlwaysA implements Player {
- AlwaysA() {}
- @Override
- public void reset() {}
- @Override
- public int move(int opponentLastMove, int xA, int xB, int xC) {
- return 1;
- }
- }
- /*
- LIST OF OTHER PLAYER IMPLEMENTATIONS GOES HERE
- */
- class Tournament {
- Tournament(Player[] candidates, int numTurns, int numRepetitions) { ... }
- void play() { ... }
- void printResults() { ... }
- }
- public class DragosStrugarTesting {
- public static void main(String[] args) throws Exception {
- Player[] candidates = new Player[2];
- candidates[0] = new AlwaysA();
- candidates[1] = new AlwaysB();
- Tournament t = new Tournament(candidates, 1000, 100);
- t.play();
- t.printResults();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement