Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return (new ScreenHelper()).getUserInput("Enter a guess: ");
- private int boardLength = 0;
- private String[] colors = {"r", "g", "l", "y", "p", "b", "w"};
- private ArrayList<String> board = new ArrayList<String>();
- private ArrayList<String> tempBoard = new ArrayList<String>();
- private final int boardLength;
- private final String[] colors = {"r", "g", "l", "y", "p", "b", "w"};
- private final List<String> board = new ArrayList<String>();
- private final List<String> tempBoard = new ArrayList<String>();
- public void setPlayerName(String n) {
- playerName = n;
- }
- public String getPlayerName() {
- return playerName;
- }
- public class ScreenHelper {
- private ScreenHelper ();
- public static String getUserInput(String prompt) {
- String inputLine = null;
- System.out.print(prompt + " ");
- try {
- BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
- inputLine = is.readLine();
- if (inputLine.length() == 0 ) return null;
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
- return inputLine;
- }
- }
- public class Console {
- private Console ();
- public static String userInput(String msg) {
- String inputLine = null;
- System.out.print(prompt + " ");
- try {
- BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
- inputLine = is.readLine();
- if (inputLine.length() == 0 ) return null;
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
- return inputLine;
- }
- public static void output(String msg, boolean newline) {
- System.out.print(msg);
- if (newline) {
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement