Re:Arthur Whitney's one liner sudoku solver
by BobbyTables2 on Saturday October 05, 2024 @11:26PM
(#41754506)
That sounds like 100+ lines in python or similar languages…
[ Parent
| on HN ]
Re:Arthur Whitney's one liner sudoku solver
by otteromkram on Saturday October 05, 2024 @11:51PM
(#41754616)
It probably isn't. At least, not for Python.
Re:Arthur Whitney's one liner sudoku solver
by throwup238 on Sunday October 06, 2024 @01:04AM
(#41754884)
You should be able to do it in under 20 lines using the same matrix operations as the K code via numpy.
Re:Arthur Whitney's one liner sudoku solver
by anonzzzies on Sunday October 06, 2024 @03:16AM
(#41755386)
Numpy is indeed very apl. Just more horrible to me; not python-y and annoyingly verbose for the apl-er.
A few years back I made a modest attempt at writing a concise yet readable sudoku solver in Python - in about 29 lines: https://github.com/hrzn/sudoku/blob/master/sudoku.py
Could have been made shorter at the price of readability.
Re:Arthur Whitney's one liner sudoku solver
by forgotpwd16 on Sunday October 06, 2024 @08:24AM
(#41756655)
Looks nice. Since imports numpy can utilize (more of) numpy's operations to squeeze validation functions and nested fors to one. Should result in shorter code but readability will probably depend on reader's experience in array programming.