BlueLagoon: Cleaned up isStateStringWellFormed
This commit is contained in:
@@ -32,7 +32,6 @@ public class BlueLagoon {
|
|||||||
public static boolean isStateStringWellFormed(String stateString){
|
public static boolean isStateStringWellFormed(String stateString){
|
||||||
|
|
||||||
// Create an array of regex strings to match the state string
|
// Create an array of regex strings to match the state string
|
||||||
|
|
||||||
// The state string contains 5 parts, each of which is matched by a regex string
|
// The state string contains 5 parts, each of which is matched by a regex string
|
||||||
String[] matchArray = new String[6];
|
String[] matchArray = new String[6];
|
||||||
|
|
||||||
@@ -58,9 +57,7 @@ public class BlueLagoon {
|
|||||||
matchString += match;
|
matchString += match;
|
||||||
}
|
}
|
||||||
// Check if the state string matches the regex string
|
// Check if the state string matches the regex string
|
||||||
if (!stateString.matches(matchString)) {
|
if (!stateString.matches(matchString)) return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -109,7 +106,7 @@ public class BlueLagoon {
|
|||||||
// For testing purposes
|
// For testing purposes
|
||||||
// System.out.println(stateString);
|
// System.out.println(stateString);
|
||||||
|
|
||||||
// Check if the stateString is well formed
|
// Check if the stateString is well-formed
|
||||||
if (!isStateStringWellFormed(stateString)) return stateString;
|
if (!isStateStringWellFormed(stateString)) return stateString;
|
||||||
|
|
||||||
// Grab the stone circles from the stateString
|
// Grab the stone circles from the stateString
|
||||||
|
|||||||
Reference in New Issue
Block a user