FAQ Database Discussion Community


Formulate sudoku puzzle given the solutions

java,sudoku,backtracking
I just recently did a sudoku solver in java using backtracking. Is it possible, given the solutions, to formulate a problem or puzzle? EDIT to formulate the original puzzle, is there some way to achieve this? and an additional question, given the puzzle and the solutions. If I am able...

Sudoku Solver - Scilab

algorithm,runtime-error,sudoku,backtracking,scilab
I wrote a program in SciLab that solves sudoku's. But it can only solve sudoku's that always have a square with 1 possible value. Like very easy and easy sudoku's on brainbashers.com . Medium sudoku's always reach a point that they do not have a square with 1 possible value....

For loop as an input parameter of a function in python

python,sudoku
I am trying to understand solving Sudoku in Python from this website. I couldn't understand the "Search" Function in particular the application of "some" function in the "search". def search(values): "Using depth-first search and propagation, try all possible values." if values is False: return False ## Failed earlier if all(len(values[s])...

Sudoku Solver Scilab

algorithm,runtime-error,sudoku,backtracking,scilab
I am trying to write a program that solves sudoku's using backtracking. I'm using scilab at the moment. I keep getting errors in my recursive algorithm, I must be doing something wrong. Any help is welcome. I put my error code at the bottom. /////////////////////////////////////////////////////////////////////////// ////////////////////////// Check Sudoku /////////////////////////////// ///////////////////////////////////////////////////////////////////////////...

solve sudoku puzzle using A*(A-Star) search [closed]

algorithm,search,artificial-intelligence,a-star,sudoku
i want to solve sudoku puzzle using A* Search. how to define g(n) and h(n)?? what should h and g be?? i want to code that in python but any pseudo code would be appreciated...

Exit clause in recursive call

python,recursion,sudoku
I am creating a recursive algorithm to brute force a Sudoku puzzle. I have gotten everything to work properly, however, I am trying to figure out how to stop the process once it correctly finishes a puzzle. Here is what I have so far. def solve(board, cell): #calculate row and...

Finding what sector you're in , in a 6x6 sudoku puzzle? [closed]

c++,logic,sudoku
so basically i'm making a sudoku solver, and i need to check if a number is free in the current sector, i already check the rows and columns of the number, so what's left is sectors. the whole puzzle is 6x6 and has 3(2rows per sector) row sectors and 2(3...

Create int array from txt file with multilines and spaces between numbers in C [closed]

c,arrays,file,sudoku
I have a sudoku checker. I need to catch numbers of the sudoku.txt into an array of ints in C. My sudoku.txt is multi lined and the numbers are separated by " " space. 6 2 4 5 3 9 1 8 7 5 1 9 7 2 8 6...

Backtracking not getting triggered in c#

c#,sudoku
I am trying to write a code in c# for Sudoku solver. But it seems that recursion is not working correctly and backtracking is not getting fired. When i am trying to debug the code when row is 1 and col is 7 it should start unwinding and the execution...

Rspec testing a method using enumerator in Ruby. Method only runs once the fails subsequently

ruby,rspec,sudoku,enumerator
I am currently completing a Sudoku solver in ruby. Using enumerator I have create a method that creates 9 arrays based on my 9x9 grid each of which refers to a 3x3 box in the sudoku game. Whilst testing this in Rspec I am finding that it only works in...

I am trying to get simple jquery code to iterate

jquery,sudoku
I am trying to assign text to a sudoku puzzle (made with a table) using jquery and can do it by indvidual cell using the following code: $('#popSud').click(function(){ $('#1').text('1'); }); but I want to apply it to the entire 81 cell table and am trying the following code but no...

Sudoku: Selection image does not appear

java,imageicon,sudoku
I am building a Sudoku game. I have drawn a grid so far and programmed the selection of a field, but my chosen picture for selection does not appear. My Class for the selector is: package com.brendenbunker; import javax.swing.*; public class Selection { public JLabel boxSelected; public ImageIcon selected; int...

Iterative brute-force sudoku solver

java,nesting,sudoku
I am trying to implement an iterative Sudoku solver. To avoid recursion I used a stack, but I'm having problems with its management. The starting board is represented by a String array (variable 'input' in the following code) in which each element is composed of 3 numbers: the [row, col]...