Upgraded structure.
This commit is contained in:
1 parent
4b6c8231c1
commit
78df2fadd7
1 file changed
+15
-7
+15
-7
@@ -203,13 +203,7 @@ function rankShafts(brickId, dropLocation, tempBoard) {
|
||||
return rank;
|
||||
}
|
||||
|
||||
function chooseDropLocation(brickId) {
|
||||
var dropLocations = getAllPossibleDropLocations(brickId);
|
||||
|
||||
if (dropLocations.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function rank(brickId, dropLocations) {
|
||||
var bestRank = 0;
|
||||
var bestId = -1;
|
||||
|
||||
@@ -238,6 +232,20 @@ function chooseDropLocation(brickId) {
|
||||
}
|
||||
}
|
||||
|
||||
return [ bestId, bestRank ];
|
||||
}
|
||||
|
||||
function chooseDropLocation(brickId) {
|
||||
var dropLocations = getAllPossibleDropLocations(brickId);
|
||||
|
||||
if (dropLocations.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var best = rank(brickId, dropLocations);
|
||||
var bestId = best[0];
|
||||
var bestRank = best[1];
|
||||
|
||||
return dropLocations[bestId];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user