# Tagged Questions

Sudoku (数独 sūdoku?, すうどく) English pronunciation: /suːˈdoʊkuː/ soo-doh-koo is a logic-based, combinatorial number-placement puzzle. The objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 sub-grids that compose the grid (also called "boxes", "blocks", "...

3k views

### Check if a Sudoku board is filled out correctly

The code below takes a filled out Sudoku board of size NxN, with sub-blocks of nxn, and checks if the solution is correct. main_function takes a board as input. ...
146 views

### Python Takuzu solver

If you are unfamiliar with the logic puzzle game Takuzu, I learned how to play it and was inspired to make the project from this challenge posted on reddit. The short version of the game is it's a ...
61 views

### Verification of Sudoku boards

A valid Sudoku board has the following properties The board must be square (n-by-n). Let m = sqrt(n) All rows must contain the numbers 1-n All columns must ...
74 views

### Little Sudoku solver

I always have enormous difficulty working out 2D grid addresses, so for me it is easier to work with the List functions. All tests pass and I'm looking for feedback ...
93 views

### Sudoku solver in JavaScript

I decided to learn JavaScript and what better way than wrestling with a Sudoku solver. I'm guessing there are (many?) optimizations that I missed. I'm thinking of adding a generator also, but this for ...
129 views

### Sudoku Android Code

I have been programming for a long time, but nobody has given me any feedback if my code is good or not. Please review it, and give me feedback where I could be better. The source code is also on ...
91 views

### Sudoku Solver - uses DFS and Constraint Propagation

Disclaimer: My code is translated from Peter Norvig's Python code. This simple code uses only two techniques: Constraint Satisfaction and Depth-First-Search. Backtracking is not implemented. Here's ...
168 views

### Nice GUI for the sudoku solver in Java

I have implemented a GUI for my sudoku solver: You can use mouse for operating it, yet I have coded moving the cell cursor with keys wW/aA/sS/dD. My code ...
86 views

### A command line general sudoku solver in Java

I have this command line program that asks the user to (partially) input the source sudoku with some missing values, and after that validates the input and solves it. See what I have: SudokuSolver....
124 views

### Recursive backtracking Sudoku solver

I'm trying to learn more algorithmic techniques and I came across an interesting application of recursive backtracking: solving a Sudoku puzzle. I'm looking for a review concerning code style, quality,...
3k views

### Sudoku solution without the use of classes

A Sudoku puzzle is a 9 × 9 grid with some numbers between 1 and 9 in it, that has to be filled in so that every row, every column, and each of the nine 3 × 3 blocks contain all ...
56 views

### Optimal use of Python 3's multiprocessing package to create Sudoku grids

I want to create Sudoku grids using Python. As it's pretty slow if I want to create a bunch of grids, I decided to use multiprocessing. My computer has 4 virtual ...
192 views

### Java solution to check if a Sudoku solution is valid

Here's my solution to checking if a Sudoku board is valid. The algorithm checks the following, Rows add up to 45 Columns add up to 45 Rows have no duplicates Cols have no duplicates Every 3X3 sub-...
52 views

### Check if two numbers are the same in a box

I am making a Sudoku game and I have managed to add random numbers, add numbers, and to checklines (if there is 2 numbers on the same line). I am trying to check the 3x3 boxes if the number is twice ...
130 views

### Backtracing Sudoku solver

I have made a backtracking Sudoku solver in Python but it's working quite slow. Originally, It had been working on 4 by 4 grids, which worked fine. But now, trying to solve 9 by 9 grids takes a very ...
301 views

### Sudoku Solver in C++ weekend challenge

I am very new to programming (using C++) and coded a sudoku solver as a weekend challenge. I guess there are so many things to criticize, but I would really appreciate some constructive criticism. ...
88 views

### Scala code to print a Sudoku board and any possible unsolved values

I'm working through a Sudoku solver problem that I found at UPenn (no it's not my homework ;)). I'm a beginner at Scala, and I'm trying to write good functional code (not that this particular method ...
287 views

### Sudoku game with varied difficulty level

I created a Sudoku game with varied difficulty level. The Sudoku board creation process consist three stages: Creation of an empty board Filling the board with numbers Making holes in the filled ...
119 views

### Sudoku challenge driver program

For my planned Sudoku with Handicap challenge over at codegolf.SE, I need a driver program. I've decided to write it in Python, for learning purposes. Since I've got no Python experience, I thought I ...
74 views

### Sudoku type grid generator

I'm trying to make a program which prints different sized grids (n by n grids). These grids cannot have the same number in any column or row (like a Sudoku). My ...
301 views

### Sudoku Puzzle Part 1: Sudoku Class

I was recently given a Sudoku Puzzle to solve, and since I began solving many Sudoku puzzles after, I decided to attempt to create a Sudoku Puzzle viewer with JavaFX. I am not done yet, but have ...
757 views

### Sudoku solutions finder using brute force and backtracking

I'm calculating all possible solutions for a given Sudoku board with at least 17 values. My approach is a basic backtracking approach and it works. ...
135 views

### Sudoku solver in Ruby

All the test cases pass except one of the test case which runs > 10 seconds. What can I do to make my solution faster? ...
146 views

### Sudoku-solving program

This is a Sudoku solver program which uses backtracking. It is a problem from Online Judge and I made it work after some struggle, but it needs to be faster as I'm getting a Time Limit Exceeded ...
117 views

### Checking for legal sudoku boards

My problem statement is: Write a function to indicate if a given Sudoku board is legal. This function takes a Sudoku board (which you may assume is a N2xN2 2d list of integers, where N is an ...
1k views

### Sudoku Puzzle Solver

I have written a program to solve Sudoku puzzles as a (fun?) way to learn Python. It solves puzzles as a human would, using reasoning algorithms rather than brute force/backtracking, as I thought it ...
128 views

### Sudoku verifier program

I implemented a Sudoku validation program. Can this be optimized even further in terms of performance? ...
142 views

### Creating Sudoku generator and validator

I've created two classes that contain only sudoku logic. One class Sudoku generates sudoku grid and returns SudokuGrid object ...
271 views

### Sudoku game logic

I am trying to create a Sudoku game in F# and I'm having a bit of trouble with the file reading and writing. But since I've also just started programming in f# I would like to check if my thinking is ...
763 views

### Sudoku solver using forward checking

I was compelled to look into a Sudoku Solver in Java using the principles I have learned in a course, namely I wanted to make something that included backtracking and forward checking. Has anybody ...
230 views

### Recursive Sudoku Solver

I just finished up a program which takes a byte[9][9] as input and recursively does a DFS to find any solutions (including multiple solutions). I'm pretty happy ...
3k views

### Sudoku Puzzle Generator

I've written a Sudoku puzzle generator. It currently runs through each line of the 9x9 grid and places numbers randomly if they're valid. It loops over all the numbers from 1-9 and then if it finds ...
153 views

### Sudoku app for Ruby

I have written a Sudoku app for Ruby. This is my first attempt at coding in Ruby so there are sure to be lots of way to optimise it or make it more efficient. To summarise the code: it takes an input ...
208 views

### Haskell Sudoku solver using bactracking

This solves Sudoku by using backtracking. Accepts one grid where 0 represents a missing number. Here are some examples: http://norvig.com/easy50.txt The program is quite slow. Input is stdin. ...
955 views

### Checking validity of NxN Sudoku

Given a multi-dimensional array representing a board in Sudoku, the function should be able to return whether the sudoku is valid or not. Examples: ...
150 views

### Multiple for loops in Sudoku solver

I have an assignment for writing a Sudoku solver and have achieved the functionality required but a lot of the code is "ugly" and I'm wanting to simplify it but unsure how to. ...
213 views

### Sudoku validator

I've decided to learn some more Haskell writing a Sudoku validator, the function checkSudoku outputs True if the Sudoku is valid and False if it is not. I did not ...
81 views

### Ruby Sudoku X-wing solution

I have written a Sudoku solver, for the euler problem and also packaged it into a ruby gem. In my solution strategies I do a lot of iteration (double/triple nested loops, I am coming from Java/C). ...
915 views

### Sudoku generator

I managed to create a Sudoku generator but I'll just go ahead and say that it generates 1 out of 500 tries on average. I'd say that's pretty inefficient and I'd like to ask you for advice on ...
120 views

I have serious problem with my Hexadoku (16 x 16 , a - p) solver. I'd like to run the program in under 2 seconds but my solution solves it in 10 seconds. Native Code: ...
508 views

### Speed up Sudoku Solver

I made this Sudoku solver using depth first search, it takes less than 0.1 second to solve any simple solution(no guessing), but if the solution requires guessing (thus using the DFS) its time grows ...
299 views

### Reading and printing sudoku input

I have seen programs to solve sudoku puzzles but to be honest.. They were badly written. First of all, readability of the program itself was horrible and the code was really long and confusing. So I ...
873 views

### Sudoku Solver - Recursive Solve

Any ideas on making my code a bit more clean and efficient? Any criticism is appreciated. I don't like that I'm calling my lengthy DeepCopy method so many times, ...
738 views

### 4x4 Sudoku solver performance

The code is for a 4x4 Sudoku solver. It works fine when there are a small number of unfilled spaces (0's) but when I give the whole matrix input as 0's or so the solver takes a very long time. I need ...
2k views

### Sudoku Solver in Java

This is an assignment posted here. This is my first foray into OO for me. Is this design OK? Or is there something very wrong that I'm not seeing at all. Any suggestions are most welcome and needed. ...
203 views

### Generic Sudoku solver might have too many iterations

I'm trying to implement a generic Sudoku solver (with n x n puzzles). The puzzle itself is contained in the class Feld with: ...
62 views

### Hints to make Sukoku solver more Pythonic (II)

I tried to implement as many changes suggested as possible as well as expanding the code base according to the suggested link. The original question can be found here. It does solve Sudokus gives ...
610 views

### Hints to make Sudoku solver more Pythonic

As you will see, I am not very familiar with Python and NumPy but want to learn it. The following code is a very basic Sudoku solver which works fine for simple examples. Although it runs, I still ...