public { return “Answer for location (” +

public class SudokuOperations {

private int answer;
private int xLocation;
private int yLocation;
private ArrayList possibleValues = new ArrayList();
private boolean isSafe = false;

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

//Constructor for when answer is known
SudokuOperations(int answer) {
this.answer = answer;
}

//Constructor for unknown digit. Set possible values to be all digits from 1 to 9
SudokuOperations(int xLocation, int yLocation) {
for (int i = 0; i getPossibleValues() {
return possibleValues;
}

public boolean isSolved() {
return (answer != 0);
}

public boolean isSafe() {
return isSafe;
}

public int getAnswer() {
return answer;
}

public int getX() {
return xLocation;
}

public int getY() {
return yLocation;
}

//setters
public void setSafe(boolean isSafe) {
this.isSafe = isSafe;
}

public void setAnswer(int answer) {
this.answer = answer;
possibleValues.clear();
if (answer == 0) { // add all possible values from 1 to 9
for (int i = 1; i

x

Hi!
I'm Alejandro!

Would you like to get a custom essay? How about receiving a customized one?

Check it out