Skip to content

Commit

Permalink
70: regenerated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jun 5, 2016
1 parent 58132c0 commit b45cd11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
7 changes: 5 additions & 2 deletions javamm.examples/src-gen/javamm/LinearEquation.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ public static void solve(double a, double b) {
}
}
if ((a != 0)) {
System.out.println(("Solution: " + Double.valueOf(((-b) / a))));
double _minus = (-b);
double _divide = (_minus / a);
String _plus = ("Solution: " + Double.valueOf(_divide));
System.out.println(_plus);
}
}

public static void main(String[] args) {
LinearEquation.solve(0.5, (-1));
LinearEquation.solve(0.5, -1);
}
}
2 changes: 1 addition & 1 deletion javamm.examples/src-gen/javamm/Polynomial.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static double value(double[] p, double x) {
}

public static void main(String[] args) {
double[] a = { 7.439, (-10.312), (-3.845), 5.174, 2 };
double[] a = { 7.439, -10.312, -3.845, 5.174, 2 };
double _value = Polynomial.value(a, 1.426);
System.out.println(_value);
}
Expand Down
2 changes: 1 addition & 1 deletion javamm.examples/src-gen/javamm/RPSSwitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static int move(int p) {
case 4:
return 1;
default:
return (-1);
return -1;
}
}

Expand Down
15 changes: 3 additions & 12 deletions javamm.examples/src-gen/javamm/Sudoku.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static int[] nextCell(int[] c, int[][] s) {
}
}
}
return new int[] { (-1), (-1) };
return new int[] { -1, -1 };
}

public static boolean feasible(int d, int[] c, int n, int[][] s) {
Expand Down Expand Up @@ -66,16 +66,7 @@ public static boolean solvable(int[] c, int n, int[][] s) {
if (a[(d - 1)]) {
s[c[0]][c[1]] = d;
int[] nc = Sudoku.nextCell(c, s);
boolean _and = false;
boolean _greaterEqualsThan = (nc[0] >= 0);
if (!_greaterEqualsThan) {
_and = false;
} else {
boolean _solvable = Sudoku.solvable(nc, n, s);
boolean _not = (!_solvable);
_and = _not;
}
if (_and) {
if (((nc[0] >= 0) && (!Sudoku.solvable(nc, n, s)))) {
s[c[0]][c[1]] = 0;
} else {
return true;
Expand All @@ -89,7 +80,7 @@ public static void main() {
int[][] s = { new int[] { 4, 0, 0, 0 }, new int[] { 0, 0, 0, 3 }, new int[] { 0, 1, 3, 0 }, new int[] { 0, 0, 0, 2 } };
int n = 2;
Sudoku.printBoard(s);
int[] p = Sudoku.nextCell(new int[] { 0, (-1) }, s);
int[] p = Sudoku.nextCell(new int[] { 0, -1 }, s);
boolean _solvable = Sudoku.solvable(p, n, s);
System.out.println(_solvable);
Sudoku.printBoard(s);
Expand Down

0 comments on commit b45cd11

Please sign in to comment.