Hello.
I want to share with you a program that can help you, and sometimes solve a sudoku puzzle.
It was started on it in my last days of vacation when I started developing a PLC withdrawal syndrome.
Yes, I know I am some years late as the big sudoku hype mostly is over by now. But I was quite impressed when I saw this video of a LEGO Mindstorm that is able to scan and interpret a Sudoku puzzle on paper (OCR), solve it and then write down the solution.
https://youtu.be/Mp8Y2yjV4fU
At least a PLC should be able to solve a puzzle, and primary not using brute force, but instead use reasoning.
So then I went at it and found out two ways of reasoning where the numbers should go.
The main idea is to reduce the allowed numbers for each cell until there was only one number allowed in the cell in focus.
I call it Sudoku helper since it will not solve the hardest ones.
If anyone have an interest, I'm open for suggestions for further improvements or optimizing of the code.
I know there is other ways of solving this with boolean logic, but I wanted to try to hone my SCL experience.
Ref:http://www.plctalk.net/qanda/showpost.php?p=138239&postcount=13
You should be able to run the project on PLCsim and Wincc Runtime without much hassle, just set the PLCsim interface to Profibus. The mainscreen on the HMI is "01_Solving"
I have made some VAT-tables for a crude way of entering problems into the DB. I started to make a program that checks if the problem is a valid one, but I got bored and went straight to the problemsolving methods instead.
I have written most of it in English, some of it is in Norwegian, but that is abandoned program bits intended for later development.
Since the archived project is almost 3MB, I share it on Dropbox:
https://www.dropbox.com/s/ciozqzhgne605l3/SudokuHelper_20150922.zip?dl=0
-Hope you find something interesting or useful.
Knut A. B.
I want to share with you a program that can help you, and sometimes solve a sudoku puzzle.
It was started on it in my last days of vacation when I started developing a PLC withdrawal syndrome.
Yes, I know I am some years late as the big sudoku hype mostly is over by now. But I was quite impressed when I saw this video of a LEGO Mindstorm that is able to scan and interpret a Sudoku puzzle on paper (OCR), solve it and then write down the solution.
https://youtu.be/Mp8Y2yjV4fU
At least a PLC should be able to solve a puzzle, and primary not using brute force, but instead use reasoning.
So then I went at it and found out two ways of reasoning where the numbers should go.
The main idea is to reduce the allowed numbers for each cell until there was only one number allowed in the cell in focus.
I call it Sudoku helper since it will not solve the hardest ones.
If anyone have an interest, I'm open for suggestions for further improvements or optimizing of the code.
I know there is other ways of solving this with boolean logic, but I wanted to try to hone my SCL experience.
Ref:http://www.plctalk.net/qanda/showpost.php?p=138239&postcount=13
You should be able to run the project on PLCsim and Wincc Runtime without much hassle, just set the PLCsim interface to Profibus. The mainscreen on the HMI is "01_Solving"
I have made some VAT-tables for a crude way of entering problems into the DB. I started to make a program that checks if the problem is a valid one, but I got bored and went straight to the problemsolving methods instead.
I have written most of it in English, some of it is in Norwegian, but that is abandoned program bits intended for later development.
Since the archived project is almost 3MB, I share it on Dropbox:
https://www.dropbox.com/s/ciozqzhgne605l3/SudokuHelper_20150922.zip?dl=0
-Hope you find something interesting or useful.
Knut A. B.