Page 1 of 1

[Solved] Sudoku Solver

Posted: Tue Jun 20, 2017 3:15 pm
by marcD
Hi,

Receiving a difficult sudoku, I decided to make a Basic program in Libre Office calc to solve it.
With this I had much help of this desk and also the apache uno site and the book of Pytoniak.
Now it is ready.
In 3 versions ( with plain Basic and arrays, with plain Basic and Types, with compatible basic and Classmodules)
Now, my question: Where can I publish it under general public license ?

marcD

p.s. Being Belgium, of Dutch language the explanation and variable names are in Dutch.

Re: Sudoku Solver

Posted: Tue Jun 20, 2017 8:42 pm
by Villeroy
http://www.mediafire.com/file/4fmq27hhy ... udoku1.ods
it used to be an Excel file, brilliantly programmed without any VBA. I just saved my ods backup on mediafire. I forgot to add a tribute to the original author. Now I can't find him anymore on the internet.

Another one from an Excel program manager at Microsoft, of course without VBA: https://blogs.office.com/2008/09/30/bui ... n-part-12/

Re: Sudoku Solver

Posted: Wed Jun 21, 2017 11:45 am
by Lupp
There is a "Macro Repository" for OpenOffice on sourceforge. See FORUM links in the "Code Snippets" branch of this forum. It doesn't seem to be remarkably vivid, but some of the offers there are still downloaded once in a while. As I suppose your code is too large to put it directly into a code box of a post into the Code Snippets branch, you may post it there contained in an attachment.

Sorry. I just checked and found the sourceforge repository "abandoned" (while still offering downloads).

You surely also considered to test your code in LibreOffice.

Re: Sudoku Solver

Posted: Wed Jun 21, 2017 1:55 pm
by Villeroy
Simply move the modules and dialogs into a document library that is NOT "Standard". The document can be used for examples and documentation. Libraries other than "Standard" can be imported and exported.

Re: Sudoku Solver

Posted: Wed Jun 21, 2017 3:23 pm
by marcD
Hi,

I looked at the solver by Mediafire
The formulas looked quite complicated, and I really did not understand.
But they could solve the Added Sudoku's
Then I tried to solve more complicated Sudoku's (see attachments) with it and it did not succeed.
With my solver I can solve the difficult one in 1h30min and the not so difficult one in 2min30s
The other suggestion leads to a manual-instruction set to create the formulas to solve a Sudoku, not a solver.
thanks for al the suggestions.
I still don't know where to publish the sudoku for public use.
marcD

ps. I understand that macro's are dangerous and should not be trusted, unless found on trusted sites
ps. I include the two Sudoku's I used for testing my sudoku.ods
ps. You can find my solver on http://home.scarlet.be/dirickx on the bottem side of the Page.

Re: Sudoku Solver

Posted: Fri Jun 23, 2017 9:13 am
by eremmel
Calc based solver is for not so difficult Sudokus because its solve-level/depth is fixed. I'm not sure how you programmed, but you should try this Sudoku to solve:
DifficultSudoku.png
DifficultSudoku.png (13.57 KiB) Viewed 10654 times
 Edit: 2026-04-08: Broken link -- MrProgrammer, forum moderator 
Above one is from this paper

Re: Sudoku Solver

Posted: Sat Jun 24, 2017 12:05 am
by marcD
Indeed, a very interesting Paper.
I will read it turoughly tomorrow.
My Solver solved the sudoku in 3min30 s.
Comparing with the other program muuuuuch more slowly.
Anyway, the project was also about learning to use basic for OOo (or libre office).
I published the calc with the macro on my website.
As mentioned before.
Now I will close the question.
PS basically my program solves some easy finds,
then looks for a branching with two possibilities,,
then investigates these etc...

Re: [Solved] Sudoku Solver

Posted: Sat Dec 07, 2024 8:32 am
by donaldhere
It's great to hear that you've developed a Basic program to solve Sudoku in LibreOffice Calc! Publishing it under a General Public License (GPL) is a great way to share it with the wider community. There are several places where you can publish your code under the GPL and make it available to others:

1. GitHub
- GitHub is one of the most popular platforms for sharing code. You can create a repository and upload your project there. It's easy to manage, and you can specify the GPL license in the repository settings. You can also keep track of any changes or improvements made to the code.

2. GitLab
- GitLab is another popular alternative to GitHub. It allows you to host your code in a public repository and also provides tools for version control, project management, and collaboration.


3. SourceForge
- SourceForge is an open-source hosting platform where you can upload your project and make it available under a GPL license. It has been around for a long time and is another good option for open-source projects.


Steps for Publishing:
1. Create a new repository on the platform of your choice (e.g., GitHub, GitLab).
2. Upload your code files.
3. Add a `LICENSE` file that contains the GPL text. You can copy the text from the official GNU website. I got mine for https://nytsudoku.net/
4. Write a `README` file explaining your project, how to use it, and any other relevant information. Make sure to mention that it's licensed under the GPL.
5. Optionally, if you're working in Dutch, you could also consider including an English translation of your documentation for broader accessibility.

By sharing your program with the GPL license, you're allowing others to use, modify, and distribute the code, while also ensuring that future improvements remain open and free for all.

Good luck with your project!

Re: [Solved] Sudoku Solver

Posted: Sat Dec 07, 2024 12:43 pm
by Villeroy
https://extensions.libreoffice.org/en/e ... /show/1984 works with OpenOffice and LibreOffice. It solves the puzzle by eremmel » 2017-06-23 7:13 Fri lightning fast.
Usage: =PYSUDOKU(A1:I9) [Ctrl+Shift+Enter] where A1:I9 is a 9x9 cell range containing the puzzle. The array function returns a 9x9 array containing the solution or #VALUE! in case of failure.
Side note: The extension is tagged as "Macro". An add-in function is not a macro.