import java.io.*; class Human implements Player { private long played,won; private String name; private BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); public long gamesPlayed() { return played; } public long gamesWon() { return won; } public void reset() { played = won = 0; } public Human() { System.out.println("Enter name:"); try { name = bf.readLine(); } catch (IOException ioe) {} } public int makeMove(State state) { System.out.println( state ); System.out.println( name+" card to play:"); int play = 0; try { play = Integer.parseInt(bf.readLine())-1; } catch (IOException ioe) { ioe.printStackTrace(); } while( state.cards[play] < 1 ) { play = (int)(Math.random()*6); } return play; } public void onYourMove(State state) { } public void onStart(State state) { } public void onEnd(State state) { if (!(this == state.loser)) { won++; System.out.println( name+" won"); } else System.out.println( name+" lost"); played++; } public void onOpponentMove(State state) { } }