Skip to content

Commit f6c2c4b

Browse files
committed
Remove Scanner param to BineroScan.run, pass boolean instead
1 parent 45cb9ae commit f6c2c4b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/test/groovy/net/zomis/machlearn/images/BineroScan.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public static void main(String[] args) {
2929
BineroScan scan = new BineroScan();
3030
do {
3131
BufferedImage image = MyImageUtil.screenshot();
32-
scan.run(image, scanner);
32+
scan.run(image, true);
3333
System.out.println("Go again?");
3434
} while (scanner.nextLine().equals("y"));
3535
scanner.close();
3636
}
3737

38-
public void run(BufferedImage image, Scanner scanner) {
38+
public void run(BufferedImage image, boolean click) {
3939
ZRect[][] boardRects = imageToRects(imageToRects, imageToRects.flip(), image);
4040
String board = valuesForBoard(image, boardRects);
4141
System.out.println(board);
@@ -61,9 +61,7 @@ public void run(BufferedImage image, Scanner scanner) {
6161
if (analysis.getTotal() == 1) {
6262
String solution = IntegerPoints.map(analysis.getSolutions().get(0).getSetGroupValues(), size.get());
6363
String[] solutionRows = solution.split("\n");
64-
System.out.println("Start clicking? (Y/N)");
65-
String in = "y";
66-
if (in.equals("y")) {
64+
if (click) {
6765
MyRobot robot = new MyRobot();
6866
for (int y = 0; y < solutionRows.length; y++) {
6967
String solutionRow = solutionRows[y];

0 commit comments

Comments
 (0)