Live data from Hacker News

Arthur Whitney's one liner sudoku solver (2011)

dfns.dyalog.com

91–100 of 210 posts

Re: Arthur Whitney's one liner sudoku solver (2011)

#91
post #55

Does anyone have any thoughts on what motivates people to play sudoku or write solvers for sudoku ? I have trouble finding motivation to solve artificial problems. That said I sink hundreds of hours into factorio.

All games are artificial problems, so your question actually is, what motivates people to engage in pastimes?

Sudoku, crosswords, Simon Tatham's puzzles etc. are an excellent way to pass the time while keep training the mind. Sports are their equivalent for the body.

Finally, writing solvers for a problem, be it real or artificial, for many is just another variety of puzzle to engage in.

Re: Arthur Whitney's one liner sudoku solver (2011)

#92
post #55

Does anyone have any thoughts on what motivates people to play sudoku or write solvers for sudoku ? I have trouble finding motivation to solve artificial problems. That said I sink hundreds of hours into factorio.

I don’t care much for sudoku but I do enjoy crosswords quite a lot, which feels like a somewhat arbitrary exercise. I enjoy the fact that I know a lot of words and it makes me feel clever. There’s probably something to that with most puzzle type challenges.

Re: Arthur Whitney's one liner sudoku solver (2011)

#93
post #86
post #69

Earlier quoted context omitted.

> how will you ever debug it? By being so smart that your program has obviously zero bugs in it!

This view is too static. That is not possible, because the environment can (and at some point always will) change which wasn't planned for due to a lack of working crystal balls. Data, user behavior, the network, the system(s) the software runs on can all change over time. Also, it is way too expensive to try to cover every single conceivable possibility, so we deliberately leave holes. For non-trivial things we ofte…

you might've missed the quip, since this whole thread is about a quote, which i'm countering with an alternative quote from Hoare

> There are two methods in software design. One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.

Re: Arthur Whitney's one liner sudoku solver (2011)

#94
post #20
post #16

> Advocates of the language emphasize its speed, facility in handling arrays, and expressive syntax. Indeed. https://en.m.wikipedia.org/wiki/K_(programming_language)

“Expressive” = like two cats fought while standing on the keyboard

I've been messing with Uiua (https://www.uiua.org/) a good amount recently, and find its sort of dance between having a stack and being an array language somehow gets you to a nice level of legibility despite being a combo of two styles that tend to generate line noise.

Re: Arthur Whitney's one liner sudoku solver (2011)

#95
post #21

I'll sometimes gauge code complexity by comparing the number of lines of code against the output of tar -cf - . | gzip | base64 | wc -l IE "how much does it compress?" Looking at APL -- I'm reminded of what happens if I accidentally send the gzipped output to my tty... I'm impressed that there's anyone who can follow along (can you find the bug?) to code like p←{(↑⍵)∘{(⍺∨.=⍵)/⍳n×n∘}¨,⍵},(n*÷2){⍵,⍺⊥⌊⍵÷⍺}'⍳n n←⍴⍵ It re…

Legitimately curious how APL programmers think about maintainability and readability. Is code just thoroughly commented or otherwise documented?

my impression is that the language is used more for scripts than for "code" in a true sense. A bit of "how much can you juggle in your mind" going on

Re: Arthur Whitney's one liner sudoku solver (2011)

#96

Sudoku was always a meditative thing for me. It’s impossible not to win so long as you pay attention. Optimizing solutions seems contrary to the point to me.

Interesting position that was not expressed before. However please note that the same could be said about writing a solver.

Re: Arthur Whitney's one liner sudoku solver (2011)

#98
post #90

Lines of code is a poor metric, because languages use lines differently. A much better measure would be the number of nodes in a parse tree, of semantically meaningful non-terminals like "a constant" or "a function call". An even better measure would also involve the depth and the branching factor of that tree.

The preferred measure of information content is simply number of bits as used for instance in Algorithmic Information Theory [1].

[1] https://en.wikipedia.org/wiki/Algorithmic_information_theory

Re: Arthur Whitney's one liner sudoku solver (2011)

#99
post #60

[flagged]

Please don't litter HN with LLM spam, it adds nothing of value to the discussion. You even said it yourself, you have no idea if any of the word vomit is true or not.

It's your comment that's adding nothing

It's very interesting that Claude can at least figure out it's a sudoku solver in K where chatgpt fails

Re: Arthur Whitney's one liner sudoku solver (2011)

#100
The LoC count and similar metrics have the advantage of an easy calculation.

Ultimately though,they are a proxy to a more relevant but difficult to determine attributes such as

Given a reasonably proficient engineer, the amount of time it would take them to resolve a bug in code written by someone else or alternatively extend its functionality in some way.

Post reply on HN