style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -51,9 +51,7 @@ public class MazeRecursion {
setWay2(map2, 1, 1);
// Print out the new map1, with the ball footprint
System.out.println(
"After the ball goes through the map1show the current map1 condition"
);
System.out.println("After the ball goes through the map1show the current map1 condition");
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 7; j++) {
System.out.print(map[i][j] + " ");
@ -62,9 +60,7 @@ public class MazeRecursion {
}
// Print out the new map2, with the ball footprint
System.out.println(
"After the ball goes through the map2show the current map2 condition"
);
System.out.println("After the ball goes through the map2show the current map2 condition");
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 7; j++) {
System.out.print(map2[i][j] + " ");
@ -85,7 +81,7 @@ public class MazeRecursion {
* means the ball has gone through the path but this path is dead end
* 5. We will need strategy for the ball to pass through the maze for example:
* Down -> Right -> Up -> Left, if the path doesn't work, then backtrack
*
*
* @author OngLipWei
* @version Jun 23, 2021 11:36:14 AM
* @param map The maze
@ -99,7 +95,8 @@ public class MazeRecursion {
}
if (map[i][j] == 0) { // if the ball haven't gone through this point
// then the ball follows the move strategy : down -> right -> up -> left
map[i][j] = 2; // we assume that this path is feasible first, set the current point to 2 first。
map[i][j] = 2; // we assume that this path is feasible first, set the current point to 2
// first。
if (setWay(map, i + 1, j)) { // go down
return true;
} else if (setWay(map, i, j + 1)) { // go right
@ -129,7 +126,8 @@ public class MazeRecursion {
}
if (map[i][j] == 0) { // if the ball haven't gone through this point
// then the ball follows the move strategy : up->right->down->left
map[i][j] = 2; // we assume that this path is feasible first, set the current point to 2 first。
map[i][j] = 2; // we assume that this path is feasible first, set the current point to 2
// first。
if (setWay2(map, i - 1, j)) { // go up
return true;
} else if (setWay2(map, i, j + 1)) { // go right