package com.north.gamecore;

public class Utils {

    public static int parseInput(String input) {
        int num = -1;
        try {
            num = Integer.valueOf(input);
        } catch(Exception e) {
            num = 99;
        }
        return num;
    }

    public static void sleep(int second) {
        try {
            for (int i=0; i<second; i++){
                Thread.sleep(1000);
                System.out.println("...");
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}

@@ -44,16 +44,2172 @@
 tils %7B%0A%0A
+    public static boolean parseOptionSelection(int num, Player player, String history) %7B%0A        boolean showOptionMenu = true;%0A        switch(num) %7B%0A            case 1:%0A                // 1: ready to play%0A                showOptionMenu = false;%0A                break;%0A            case 2:%0A                // 2: show my cards in hand%0A                player.printNotUsedCards();%0A                break;%0A            case 3:%0A                // 3: show my cards played%0A                player.printUsedCards();%0A                break;%0A            case 4:%0A                // 4: show opponent's cards played%0A                player.getOpponent().printExposedCards();%0A                break;%0A            case 5:%0A                // 5: show the score board%0A                UserInterface.clearConsole();%0A                UserInterface.printScoreBoard(player, player.getOpponent());%0A                break;%0A            case 6:%0A                // 6: show the battle history%0A                UserInterface.printBattleHistory(history);%0A                break;%0A            default:%0A                UserInterface.print(%22Input err, please choose from 1-7!%22);%0A                sleep(1);%0A                UserInterface.clearConsole();%0A        %7D%0A        return showOptionMenu;%0A    %7D%0A%0A    /**%0A     * given a card num, return the card if available%0A     * @param num%0A     * @param player%0A     * @return%0A     */%0A    public static Card parseCardSelection(int num, Player player, Deck CommonDeck) %7B%0A        Card playersCard = null;%0A        if (num%3E=0 && num%3C=7) %7B%0A            playersCard = CommonDeck.getCards().get(num);%0A            if (player instanceof AI %7C%7C player.haveThisCard(num)) %7B // assume AI will always play right%0A                return playersCard;%0A            %7D else %7B%0A                UserInterface.println(%22Input err, please choose a NOT USED card!%22);%0A                sleep(1);%0A                return null;%0A            %7D%0A        %7D else %7B%0A            UserInterface.println(%22Input err, please choose from 0-7!%22);%0A            sleep(1);%0A            return null;%0A        %7D%0A    %7D%0A%0A    /**%0A     * parse input String to number, catch exception%0A     * @param input%0A     * @return%0A     */%0A
     publ
@@ -2413,24 +2413,100 @@
 num;%0A    %7D%0A%0A
+    /**%0A     * sleep for some time, printing .%0A     * @param second%0A     */%0A
     public s

Update Utils.java