Alphahabet Sudoku Solver! Write a solver for the 16 times 16 letter sudoku puzzl
ID: 3839250 • Letter: A
Question
Alphahabet Sudoku Solver! Write a solver for the 16 times 16 letter sudoku puzzle below (you can use numbers from 1 to 16 as well). Test it with a sample starting Sudoku puzzle with some of the letters filled in. Print out a possible solution for the puzzle (make sure you use lower case letters). Submit your Prolog file along with a screen shot of your test. You may use the swipl prompt if you want, or run it as a script, or run it in this interpreter found here: 5 Extra Credit points: write it as a script that reads the starting puzzle from a text file, and outputs at least one solution to another text.Explanation / Answer
public class Sudoku { /** * Print the specified Sudoku problem and its solution. The * problem is encoded as specified in the class documentation * above. * * @param args The command-line arguments encoding the problem. */ public static void main(String[] args) { int[][] matrix = parseProblem(args); writeMatrix(matrix); if (solve(0,0,matrix)) // solves in place writeMatrix(matrix); else System.out.println("NONE"); } static boolean solve(int i, int j, int[][] cells) { if (i == 9) { i = 0; if (++j == 9) return true; } if (cells[i][j] != 0) // skip filled cells return solve(i+1,j,cells); for (int val = 1; valRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.