Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created January 19, 2014 22:54
Show Gist options
  • Save tarynsauer/8512097 to your computer and use it in GitHub Desktop.
Save tarynsauer/8512097 to your computer and use it in GitHub Desktop.
public String getNextMove() {
String move = "0";
while (!board.validMove(move)) {
try {
move = bufferedReader.readLine();
} catch (IOException e) {
e.printStackTrace();
} catch (NumberFormatException e) {
e.printStackTrace();
} finally {
if (!board.validMove(move)) {
badInputMessage(move);
}
}
}
return move;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment