public class TakeAwayApp {    private KeyboardReader reader;    private TakeAwayGame game;    public TakeAwayApp() {        reader = new KeyboardReader();        game = new TakeAwayGame(21);    }        public void run() {	int sticksLeft = game.sticksLeft();        reader.display("Let's play the TakeAway game\n");        reader.display("There are " + sticksLeft + " sticks left.\n");        reader.display("You can pick up 1, 2, or 3 at a time\n.");        reader.display("You go first.\n");        while (game.gameOver() == false) {                  if (game.getPlayer() == game.USER) 		        userMove();	        else		        computerMove();            sticksLeft = game.sticksLeft();            reader.display("There are " + sticksLeft + " sticks left.\n");	    }		    if (game.getWinner() == game.USER) {            reader.display("Game over. You win. Nice game.\n");	    } else {            reader.display("Game over. I win. Nice game.\n");	    }    }    private void userMove() {        reader.prompt("How many sticks do you take, up to " + TakeAwayGame.MAX_TAKE_AWAY + " : ");        int userTakes = reader.getKeyboardInteger();        if (game.takeAway(userTakes)) {            reader.display("You take " + userTakes + ".\n");	} else {            reader.display("Sorry, you can't take " + userTakes + ". Try again\n");	}    }    private void computerMove() {        int maxTakeAway = Math.min(game.sticksLeft(), TakeAwayGame.MAX_TAKE_AWAY);        int computerTakes = 1 + (int)(Math.random() * maxTakeAway);	game.takeAway(computerTakes);        reader.display("I take " + computerTakes + ". ");    }    public static void main(String args[]) {        TakeAwayApp app = new TakeAwayApp();        app.run();    }}