diff --git a/readers/Reader.java b/readers/Reader.java index ce1203c..036e64f 100644 --- a/readers/Reader.java +++ b/readers/Reader.java @@ -301,7 +301,11 @@ public abstract class Reader{ } } } - return Double.parseDouble(Integer.toString(numb)+"."+Integer.toString(decimal)); + try { + return Double.parseDouble(Integer.toString(numb)+"."+Integer.toString(decimal)); + } catch (NumberFormatException e) { + return 0; + } } int convertToInt(String[]data){return convertToInt("",data);} @@ -438,7 +442,7 @@ public abstract class Reader{ if (this.other.length()>0 && other.other.length()>0 && !this.other.equals(other.other)) { return false; } - if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct)) { + if (Double.compare(pct,other.pct)!=0) { System.out.println("Doubles don't match!"); return false; } diff --git a/sigPlace.java b/sigPlace.java index 82f88f6..6f188ef 100644 --- a/sigPlace.java +++ b/sigPlace.java @@ -107,7 +107,7 @@ public class sigPlace { Reader lastReader = null; Reader lastSubmittedReader = null; int matches=0; - final int EXPECTED_MATCHES=7; + final int EXPECTED_MATCHES=5; boolean submitted=false; while (true) { BufferedImage screenshot = r.createScreenCapture(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());