this post was submitted on 29 Jun 2023
8 points (100.0% liked)

Linux

8881 readers
237 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.world/post/807258

A script in C language that can solve sudoku riddles.

https://gitlab.com/christosangel/sudoku-solver

all 4 comments
sorted by: hot top controversial new old
[–] j4k3 2 points 2 years ago (1 children)

I wish I had a puzzle filter for Open Sudoku puzzles that could tell me if there is a solution that does not require guessing. I have no clue how that could be coded but I'd like to learn how to approach such a problem

[–] christos 3 points 2 years ago (1 children)

By guessing I imagine that you refer to the situation when you reach a point, where all logic paths are a dead-end; all except one: reductio ad absurdum, or apagogical statememt. In this case you claim (guess) that a square has a specific, and begin to solve the rest as if that claim was valid. If things work, all is well, if not you prove that claim invalid, go back and start with an alternative value.

I am not that deep into sudoku solving to make a script to generate sudoku riddles that do or don't include this logic method. This script only brute forces all possible combinations, until it reaches the solution.

I have no clue how that could be coded but I’d like to learn how to approach such a problem

You and me both!