Example #1
0
 private int findIndex2(String rule) {
   rule = rule.trim();
   if (rule.startsWith("m")) {
     int n = Integer.parseInt(rule.substring(1));
     return -1 * Math.abs(n);
   }
   return Integer.parseInt(rule);
 }
Example #2
0
 private int random(int n) {
   return (int) (Math.random() * n);
 }
Example #3
0
 public double h(double v) throws Exception {
   double v1 = find(o1, v);
   double v2 = find(o2, v);
   return Math.pow(v1, v2);
 }
Example #4
0
 protected int distanceTo(int[] p1, int[] p2) {
   return Math.abs(p1[0] - p2[0]) + Math.abs(p1[1] - p2[1]);
 }
Example #5
0
 public double h(double v) throws Exception {
   double v1 = h1.h(v);
   double v2 = h2.h(v);
   return Math.pow(v1, v2);
 }