Coding a Sudoku Solver in C - Part 1

preview_player
Показать описание
In this tutorial series we code a sudoku solver using C.
Part 1 deals with entering a puzzle into C and printing the puzzle out.

Puzzle in video can be found here:
Рекомендации по теме
Комментарии
Автор

Yeah, you don't need any malloc() in this. You can just put the int array[9][9] on the stack and pass a pointer to that around. Saves overhead and you don't need to check if the malloc() succeeded.

blenderpanzi
Автор

Yep I followed the tutorial until the terminal part. I don't get what happens after that. I'm aware that a secondary program has to be used to run the C text but I don't know which one to download. P.S I am a novice at this so...

umar
Автор

what is malloc.? what did you do there in that part.? why didn't you simply return an array.? why is that not possible?

Muradsahar
Автор

Returning a pointer to a local/auto/stack variable (like „array“) doesn‘t work. The variable doesn‘t exist outside the function‘s scope.

elclippo
Автор

Great video. Can you explain the use of double pointer within the declaration and malloc (as opposed to single pointer) and why you are only referencing only one of the two array dimensions inside the for loop?

PlayCheez
Автор

Program received signal SIGSEGV, Segmentation fault.
in createPuzzle () at puzzle.c:26
26 puzzle[i][j]=array[i][j];

xmlkb
Автор

Why not find a way to redirect any sudoku puzzle as a file and save it into that array with scanf? This way you can solve any sudoku puzzle without having to do all this extra work of hardwiring it into the code.

orinpemulus
Автор

heh man great video, could tell me which compiler you used ;also if you could create a tutorials about how to create a memory match game in c language; thks in advance

themauritianrender
Автор

In the file puzzle.c, what's the difference between the variable "puzzle" and "array"? why don't you just return "array"? Thanks.

pilipp
Автор

broo i copy this code is BlockNote and he make me so much error, you can help me pls ? this code is only for sublime text and linux or what ?

dcladeen
Автор

hey, which platform did you use for coding??

rishabhbhatnagar
Автор

Hello there, I ve followed your instructions step by step and I am facing the following errors while trying to run it:
sudoku.c:(.text+0xe): undefined reference to `createPuzzle'
sudoku.c:(.text+0x1e): undefined reference to `printPuzzle'
[Error] ld returned 1 exit status

I am using Dev c++ at windows. Thanks in advance

jimmanikas
Автор

Is anyone having segfaults with their array after they try to run the compiled program?

walkergreen
Автор

I'm new to c++, so i was wondering what kind of implementation is this project, like is it graph coloring or what?
cheers

princeofthepharaohs