Q:

Trying to have a specific method executed when enter is pressed in console using while loop but instead the loop exits

So the method which involves 'looping' is this: 
public static void play(World world) throws IOException {
    int userResponse = 0;
    Writer w = new OutputStreamWriter(System.out);
    while (userResponse != 'q') {
        world.print(w);
        System.out.println("Printed ok");
        userResponse = System.in.read();
        world = world.nextGeneration(0);
    }
}

and it calls the 'print' function which is here: 
public void print(Writer w) {
    PrintWriter pw = new PrintWriter(w);

    pw.println("-");
    for (int row = 0; row < cells.length; row++) {
        for (int col = 0; col < cells[0].length; col++) {
            pw.print((getCell(col, row) ? "#" : "-"));
        }
        pw.println();
    }
    pw.flush();

}

What should happen is that when run, the program prints the instance of 'world' [For context this is a game of life simulator] in the console, and then updates 'world'. Then on pressing enter the updated version of 'world' should be printed. When 'q' is inputted the program exits.
However what happens is that the first instance of 'world' is displayed but on pressing enter it exits the loop instead of displaying the next instance. Any glaring mistakes I've missed? 

A:

This properly loops until I enter 'q'
public static void main(String[] args) throws Exception {
    int userResponse = 0;
    while (userResponse != 'q') {
        System.out.println("Printed ok");
        userResponse = System.in.read();
    }
}

