Created
March 29, 2015 11:57
-
-
Save anil9/9fd3aee9e533f1e24790 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean solved(){ | |
String[] colors = front.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
colors = left.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
colors = right.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
colors = top.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
colors = bot.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
colors = back.getColors(); | |
for(int i = 1; i < 9; i++){ | |
if(!colors[0].equals(colors[i])){ | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment