public boolean restartGame() {

        Scanner input= new Scanner(System.in);

        System.out.println("Do you want to restart the game?[y/n] ");
        String str;

        char ans = 0;

        do {

            str = input.next();
            if (str.length() == 1) {

                char []var = str.toCharArray();

                ans = var[0];

                if (!((var[0] == 'y' ) || (var[0] == 'n'))) {

                    wrongInputMessage();

                }
            } else {

                wrongInputMessage();

            }

        } while(!(ans == 'y' || ans == 'n'));

        if (ans == 'y') {

            return true;

        } else {
            System.out.println("Good bye!");

            return false;

        }


    }