Skip to content

Instantly share code, notes, and snippets.

@anil9
Created March 29, 2015 11:57
Show Gist options
  • Save anil9/9fd3aee9e533f1e24790 to your computer and use it in GitHub Desktop.
Save anil9/9fd3aee9e533f1e24790 to your computer and use it in GitHub Desktop.
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