public static void main(String[] args)
            throws NumberFormatException, IOException {
        BufferedReader bufReader =
                new BufferedReader(
                        new InputStreamReader(System.in));

        LifeGame game = new LifeGame(10, 25);

        System.out.println("Game of life Program");
        System.out.println(
                "Enter x, y where x, y is living cell");
        System.out.println("0 <= x < 10, 0 <= y < 25");
        System.out.println("Terminate with x, y = -1, -1");

        while(true) {
            String[] strs = bufReader.readLine().split(" ");
            int row = Integer.parseInt(strs[0]);
            int col = Integer.parseInt(strs[1]);

            if(0 <= row && row < 10 && 0 <= col && row < 25)
                game.setCell(row, col);
            else if(row == -1 || col == -1) {
                break;
            }
            else {
                System.out.print(
                        "(x, y) exceeds map ranage!");
            }
        }

        while(true) {
            game.outputMap();
            game.next();

            System.out.print(
                    "\nContinue next Generation ? ");

            String ans = bufReader.readLine().toUpperCase();

            if(!ans.equals("Y"))
                break;
        }
    }