equal
deleted
inserted
replaced
1 package ru.bosony.solvers; |
1 package ru.bosony.solvers; |
2 |
2 |
|
3 import java.io.BufferedReader; |
3 import java.io.IOException; |
4 import java.io.IOException; |
|
5 import java.io.InputStreamReader; |
4 |
6 |
5 import ru.bosony.model.mine.Mine; |
7 import ru.bosony.model.mine.Mine; |
6 |
8 |
7 /** |
9 /** |
8 * @author indvdum (gotoindvdum[at]gmail[dot]com) <br> |
10 * @author indvdum (gotoindvdum[at]gmail[dot]com) <br> |
38 public static void main(String[] args) throws IOException, InterruptedException { |
40 public static void main(String[] args) throws IOException, InterruptedException { |
39 String map = ""; |
41 String map = ""; |
40 for (String arg : args) { |
42 for (String arg : args) { |
41 map += arg + "\n"; |
43 map += arg + "\n"; |
42 } |
44 } |
|
45 if (map == null || map.length() == 0) { |
|
46 map = ""; |
|
47 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); |
|
48 String line = ""; |
|
49 while (line != null) { |
|
50 line = reader.readLine(); |
|
51 if (line != null) |
|
52 map += line + "\n"; |
|
53 } |
|
54 reader.close(); |
|
55 } |
43 map = map.replaceAll("\n$", ""); |
56 map = map.replaceAll("\n$", ""); |
44 Mine mine = new Mine(map); |
57 Mine mine = new Mine(map); |
45 Solver solver = new Solver(mine); |
58 Solver solver = new Solver(mine); |
46 solver.start(); |
59 solver.start(); |
47 } |
60 } |