public static int guessCoordinates(CoordinateStructure p1, CoordinateStructure p2) { SegmentStructure s = new SegmentStructure(); s.p1 = p1; s.p2 = p2; if (s.p1.x == 1 && s.p1.y == 2) { if (s.p2.x == 3 && s.p2.y == 4) { return(3); // 1+2 } else { return(-1); // 1-2 } } else { if (s.p2.x == 3 && s.p2.y == 4) { return(1); // -1+2 } else { return(-3); // -1-2 } } }
public static int guess(SegmentStructure s) { if (s.p1.x == 1 && s.p1.y == 2) { if (s.p2.x == 3 && s.p2.y == 4) { return(3); // 1+2 } else { return(-1); // 1-2 } } else { if (s.p2.x == 3 && s.p2.y == 4) { return(1); // -1+2 } else { return(-3); // -1-2 } } }
public static int guessParams(int x1, int y1, int x2, int y2) { SegmentStructure s = new SegmentStructure(); s.p1.x = x1; s.p1.y = y1; s.p2.x = x2; s.p2.y = y2; if (s.p1.x == 1 && s.p1.y == 2) { if (s.p2.x == 3 && s.p2.y == 4) { return(3); // 1+2 } else { return(-1); // 1-2 } } else { if (s.p2.x == 3 && s.p2.y == 4) { return(1); // -1+2 } else { return(-3); // -1-2 } } }