import java.io.IOException;
import java.util.Scanner;

public class CatchTheMouse {
    public static void main(String[] args) throws IOException {

        Scanner scanner = new Scanner(System.in);
        int width;
        int height;
        int round = 0;

        System.out.println("Welcome to Catch the Mouse");
        Game game = Game.getInstance(10, 10);

        try {
            while(!game.gameOver())
            {
                game.writer.newLine();
                game.writer.write("Round " + round);
                game.writer.newLine();
                game.printField();
                game.mouse.movePlayer();
                game.cat.movePlayer();
                Thread.sleep(1000);

                round++;
            }
            game.writer.write("Game end");
            game.writer.flush();

            System.out.println("Congrats! You caught the mouse!");
        } catch (Exception e) {
            game.writer.flush();
            e.printStackTrace();
        }
    }
}
