ANN: Dogelog Runtime, Prolog to the Moon (2021)

Avi Gross avigross at verizon.net
Thu Sep 16 17:42:30 EDT 2021


Some questions make no sense to me.

Can a kind of snake solve Sudoku? Do you mean a specific puzzle, or any puzzle or even a puzzle with no solution?

Can a programming language do it? Well, in my experience, programming languages are tools to be used by humans, or sometimes by other programming languages. They are not sentient and cannot be asked to solve much of anything.

So is the question whether someone can program using only Python to solve an arbitrary sudoku problem? Short answer is you can do that in just about ANY language. I mean by brute force, if you have a 9 by 9 matrix with some of the 81 locations already filled in, then you can try every darn combination of the other spots using digits 1 to 9 and then ignore any where the rows and columns and the 9 3x3 submatrices do not follow the rules. At least one solution is guaranteed to pop out if there is one. Sure, such methods may run out of memory or take a while, but many can use little memory and some can speed things up by not going down blind alleys such as placing a number in a position where there already is the same number on the same row or column or sub-matrix.

So is the real question whether a human has already made a decent implementation in Python available? Sure, do a little searching and there are plenty of such things including some that use interesting features of python and some that are just translations from a more primitive language.



-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net at python.org> On Behalf Of Mostowski Collapse
Sent: Thursday, September 16, 2021 3:59 PM
To: python-list at python.org
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

Here is a challenge for Python.
Can Python solve Sudoku?

Mostowski Collapse wrote:
> I am not testing this use-case. But a related use-case might highlight 
> why speed did never hurt anybody.
> 
> Lets say you program a flying drone with Python, and the measurement 
> is from the drone sensor and communication systems.
> 
> Lets say you are using the idle time between measurements for some 
> complex planning. It is then not true that you have anyway
> 
> to wait for the measurement.
> 
> Hope this helps!
> 
> BTW: If somebody knows another Python implementation I am happy to 
> test this implementation as well.
> I am assuming that the standard Python python.exe
> 
> I tested amounts to CPython? Not sure. And the GraalVM is practically 
> the same as JPython? Not sure either.
> 
>> Opinion:   Anyone who is counting on Python for truly fast compute 
>> speed is probably using Python for the wrong purpose. Here, we use 
>> Python to control Test Equipment, to set up the equipment and ask for 
>> a measurement, get it, and proceed to the next measurement; and at 
>> the end produce a nice formatted report. If we wrote the test script 
>> in C or Rust or whatever it could not run substantially faster 
>> because it is communicating with the test equipment, setting it up 
>> and waiting for responses, and that is where the vast majority of the time goes.
>> Especially if the measurement result requires averaging it can take a 
>> while.  In my opinion this is an ideal use for Python, not just 
>> because the speed of Python is not important, but also because we can 
>> easily find people who know Python, who like coding in Python, and 
>> will join the company to program in Python ... and stay with us.
>> --- Joseph S.
> 

-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list