Questions tagged [sudoku]

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", "regions", or "sub-squares") contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which typically has a unique solution.

Filter by
Sorted by
Tagged with
3
votes
1answer
69 views

Sudoku Solver using rules of Sudoku and backtracking

This code tries to solve the sudoku board using the rules of sudoku. When it does not make progress in solving, it assumes a cell value and tries again. Please review my code and help me understand ...
2
votes
2answers
166 views

Recursive Sudoku solver using Python

A Sudoku solver that works recursively. I'd appreciate your comments about coding style, structure and how to improve it. Thank you very much for your time. Code structure The Solver works by ...
3
votes
0answers
78 views

A valid Sudoku Generator without backtracking in JavaScript

I am new to programming. I tried to write a valid Sudoku solver with backtracking, the performance is disappointing. So, I tried to generate a valid Sudoku generator without backtracking. The white ...
3
votes
1answer
104 views

Generalised NxN Sudoku solver using heap

My implementation of a Sudoku solver. It isn't done using the most naive way but still it does an exhaustive search with some assistance from a heap. The only constraints I have used is the basic ...
2
votes
1answer
56 views

Python sudoku solver using backtrack algorithm

My first attempt at a sudoku solver using the backtrack algorithm. ...
4
votes
1answer
56 views

Sudoku solver using backtracting and depth-first-search

I've recently finished my first ever C program. I implemented a Sudoku solver that uses backtracking. Does my code look like a proper C-program? Are there any recommendations for improving my code? <...
2
votes
1answer
155 views

Made a sudoku solver with basic GUI in C++

I've made a sudoku solver which solves a sudoku, given user input, and can also extract digits from a picture of a sudoku to solve it. I've used OpenCV and GTK+ 2.0 to achieve the above. I am very ...
1
vote
1answer
123 views

Sudoku-Solver with GUI - follow-up

Background A few months ago, I asked this and this question on my implementation of a Sudoku-Solver. I now tried to further improve this little project. Changes Minor GUI-changes Input validation "...
10
votes
3answers
3k views

Simple Sudoku Solver in Python

This is my naive approach on implementing a Sudoku solver, which is okay for simple Sudokus like this: ...
2
votes
1answer
134 views

JavaScript Sudoku Recursive Solver

Thanks for all the great feedback in Part 1. I implemented a lot of it. Here is version 2. I am looking for feedback on: Recursive solve algorithm. It's too slow. I used Chrome DevTools Performance ...
1
vote
0answers
36 views

Sudoku seed generator

The code returns a string ready to seed at sites like sudoku-solutions.com. It works great but as I couldn't find other simple examples for my level I hope for some insights on this and ways to ...
5
votes
3answers
469 views

Sudoku game in JavaScript

PHP coder here. Learning JavaScript this week. I made a sudoku game for practice. Features: Import puzzles by pasting a text string. Imported squares are gray. Your squares are white. Program doesn't ...
3
votes
1answer
60 views

C backtracking Sudoku solver

I wrote this program in C to solve a given Sudoku puzzle (represented as 2D array) using backtracking algorithm. How can I make it more efficient, maybe faster and more C-onic? This is my first post ...
3
votes
1answer
76 views

Python sudoku solver with classes

I just coded an object-oriented Sudoku solver, but I don't have any possibility to check whether I have written good code, so I thought I would just post it here for review. I have looked for other ...
1
vote
1answer
60 views

Speeding up naive backtracking Sudoku Solver in Haskell

After watching a recent computerphile video on building a very simple sudoku solver I tried to implement the same in Haskell. From this CR question I learned that it is probably a better idea to use ...
2
votes
2answers
137 views

“Smart” sudoku brute-forcer

After running my C-brute-forcer for two days on a 25x25 sudoku, I decided to re-write in Java so that it would solve it in an acceptable time frame. The idea: Make smart fields that contain all ...
12
votes
3answers
2k views

Basic Sudoku Solver

For my programming class I had to make a sudoku solver. ...
2
votes
2answers
149 views

Python Sudoku Solver

I wrote this program for a Sudoku solver in Python. It utilizes tkinter GUI. I've uploaded the project to my GitHub. Please can you have a look and let me know of ...
3
votes
1answer
134 views

Sudoku-Solver - follow-up

I've now tried to use the suggestions you can find here to improve my Sudoku-Solver. Here's the updated code: ...
4
votes
1answer
392 views

Sudoku-Solver with GUI in Java

I've wrote a Sudoku-Solver in Java, which also contains a GUI, so you can just enter the Sudoku, press "OK" and it will solve the Sudoku using backtracking. Here's the code: ...
5
votes
1answer
177 views

Sudoku Board Generator

I am working on a Sudoku board generator that generators a valid complete Sudoku board. My algorithm generates a valid board, but the runtime is variable. Time varies from ~0.2 to 8 seconds. Ideally, ...
7
votes
3answers
512 views

Displaying a Sudoku Board

For my programming class, we have been tasked with creating a Sudoku solver; the first step of the project was to create a program which would display the game board based on input provided by the ...
6
votes
2answers
141 views

Validating sudoku columns and rows

I'm writing a sudoku col/row validator, what is does is: Reads user input on how many Sudoku instances to validate. Reads the sudoku matrix grid 9x9 (for me, in my specific case 9x9) into a 2d array. ...
1
vote
1answer
56 views

Sudoku validation

Problem explanation I've written a function to validate sudoku. Given a two-dimensional 9×9 array of numbers: Each row should have each of the numbers 1–9 exactly once. Each column should have each ...
2
votes
1answer
180 views

Creating an empty Sudoku grid

I am generating a 9x9 grid on which I will play sudoku later by setting click listeners to each square on the grid. I first have a .xml file that represents a single square in the grid. This consists ...
4
votes
2answers
81 views

Solving Sudoku using computer vision, feedback on class

I have made a project at Github that uses computer vision to solve Sudokus. Since this is my first project I would really like to get some feedback on my code. Since it is not allowed to link my ...
2
votes
2answers
226 views

How to make my backtraching sudoku solving algorithm in Python faster?

I wrote a backtracking Sudoku solving algorithm in Python. It solves a 2D array like this (zero means "empty field"): ...
3
votes
1answer
594 views

LeetCode #37: Sudoku as Exact Cover Problem solved using Dancing Links

Introduction I provide a regular 9x9 Sudoku solver, reducing the puzzle to an Exact Cover Problem. The algorithm used is Knuth'...
0
votes
1answer
41 views

Python script takes input of four elements and outputs a valid 4 × 4 Sudoku grid in O(n) time, but only when given non-repeating elements

Introduction I've found a clever and fun thing to do after solving a n2 × n2 sudoku puzzle. I can take a grid as such as this one and hard-code its indices as constraints to output other 4 × 4 latin ...
3
votes
2answers
526 views

Easy-Medium Sudoku solver written in Python - No recursion/ brute force

I'm very new to software developing, I wrote this Sudoku solver in Python, it's not the best approach ever I know and that is I guess because I started taking courses in Python and programming a month ...
5
votes
1answer
103 views

Sodoku solver with arrays of bitsets

I wrote a quick sodoku solver as an exercise and am curious how to make it faster. Parsing and printing is largely irrelevant only there for readability. How can I make the code cleaner and faster? <...
3
votes
1answer
51 views

Partial Sudoku Verifier

To practice my JavaScript for future employment, I've decided to take up the challenge of writing a javascript sudoku verifier. This code only verify's one of the ...
0
votes
1answer
255 views

Generate n^2 x n^2 Sudoku in poly-time

Introduction I have created an algorithm that generates n! Sudoku Grids in poly-time.I verified the correctness of my grids with a SAT solver up to 50x50. I'm awaiting a review for improvements. It ...
2
votes
2answers
148 views

Sudoku generator using seed Sudoku

I have created a Sudoku generator in Java. Here I am using a basic solved sudoku as seed and by transposing it and shuffling its row and columns I get a new solved sudoku. ...
17
votes
2answers
3k views

Simple recursive Sudoku solver

My Sudoku solver is fast enough and good with small data (4*4 and 9*9 Sudoku). But with a 16*16 board it takes too long and doesn't solve 25*25 Sudoku at all. How can I improve my program in order to ...
4
votes
2answers
111 views

Three stage Sudoku puzzle generator

This was my first time attempting a project like this, so I figured it would improve readability, and would also just be nice If I allowed each stage to be visualized. Also, this only generates them, ...
3
votes
0answers
96 views

Java Android Sudoku solver

I made a simple and non recursive Android Java Sudoku solver implementing Algorithm X with links inspired from dancing links. The code is on Github (start with the Solver class and the ...
2
votes
1answer
2k views

Skyscraper puzzle solver in Java [closed]

For an assignment, I have created a solver for the Skyscraper Puzzle: Each puzzle consists of an N×N grid with some clues along its sides. The object is to place a skyscraper in each square, with a ...
2
votes
2answers
413 views

Valid Sudoku in Swift

This is my solution to LeetCode – Valid Sudoku in Swift. ...
3
votes
0answers
132 views

Amateur Python Sudoku Solver

I'm self-taught in Python and would have a lot of room for improvement. I made this basic Sudoku Solver mainly in order to practice the use of Class creation. I would greatly appreciate any feedback ...
3
votes
1answer
655 views

Object Oriented Sudoku Solver in Python

I started learning Python and I am preparing Sudoku Solver as my first small project. I am also trying to learn unit testing. I thought it is a good idea to ask for suggestions before I start with GUI....
2
votes
2answers
240 views

NxN Sudoku Solver

I have written a Sudoku solver which can solve arbitrary NxN grids via backtracking. Since I'm relativly new to C any feedback is welcome. Code: ...
7
votes
1answer
177 views

Sudoku-lite challenge

You can find the problem here. The example: Column A, B, and C are each 3 and together equal 9: ...
1
vote
0answers
1k views

Sudoku solver using NumPy

I come from the R language and I gradually switch to Python (Numpy and Pandas). I coded this python code for fun to solve a Sudoku grid. Could you tell me if my code is pythonic enough? For example, ...
7
votes
1answer
1k views

Fast and flexible Sudoku Solver in C++

After seeing a lot of Sudoku solvers on Code Review I decided to implement my own. My implementation aims to be very fast and flexible, supporting some Sudoku variations (irregular boxes, extra ...
6
votes
2answers
693 views

Enhance Sudoku puzzle generator

I wrote a Python script that generates a Sudoku puzzle. Everything works just fine but it takes too much time to generate puzzle from a completed board (remove_cells...
9
votes
2answers
985 views

C++ code for solving a sudoku using backtracking

I made a sudoku solver using backtracking in C++ and I would like to know what can I do to speed up my code. I am new to this language and I don't know all its special tricks yet! I was told to go to ...
6
votes
1answer
936 views

Constexpr unit tests and asserts

I'm trying out some different programming styles to experiment with the new C++ concepts. Within the experiment I was looking into how constexpr could be helpful ...
2
votes
2answers
2k views

Simple Sudoku Solver

i have made a simple sudoku solver which is a puzzle game where the player has to figure out the empty cell and checks which numbers are absent from the corresponding row, column. how can I improve ...
2
votes
3answers
3k views

Beginner's Sudoku solver in C

I'm beginner programmer and I've challenged myself to write sudoku solver in C. I have finished it in few days and now I want to make it faster. With this sample input execution time is 1.781 ...