added gitignore
[clientserver.git] / Library.java
bloba90eb1a9300d3839640c6003cedcca9a75a287de
1 import java.io.*;
2 import java.util.*;
4 public class Library {
6 private static BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
8 public static String prompt() {
9 try {
10 return read.readLine();
12 catch (IOException e) {
13 System.err.println(e);
15 return null;
18 public static String prompt(String prompt) throws IOException {
19 print(prompt);
20 try {
21 return read.readLine();
23 catch (IOException e) {
24 System.err.println(e);
26 return null;
29 public static int promptInt(String prompt) throws IOException {
30 print(prompt);
31 try {
32 return Integer.parseInt(read.readLine());
34 catch (IOException e) {
35 System.err.println(e);
37 return -1;
40 private static void print(String prompt) {
41 System.out.print(prompt);