Live data from Hacker News

Arthur Whitney's one liner sudoku solver (2011)

dfns.dyalog.com

71–80 of 210 posts

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

#71
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.

Normally I would concur, but I recently fell into a klondike solitaire binge and the only way out was to write a solver.

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

#72
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 wasted too much time in my youth trying to min-max, and now I get bored as soon as I figure out, roughly, what the rules and mechanics look like for any game.

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

#74
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?

You don't really have to worry about keeping track of tons of functions, variables, structs, classes, etc., and trying to keep all the names straight in your head - all you need is to know the symbols, so it's in some ways easier than reading a complex function in more verbose languages where you might need to lookup stuff from several libraries just to understand what's going on. Also, that one line is ~100 characters, each of which probably covers ~0.5-1 lines in other languages, so you should expect to set aside a similar amount of time to reading and understanding it.

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

#75
post #65
post #64

Earlier quoted context omitted.

Sure. but please elaborate ..

I cannot comprehend the mindset of people who decide to spam (because that is what your comment is) any forum with a page of bullshit GPT slop. Do you think it's helpful or interesting?

Personally I believe it is interesting since it shows the current state of the art for the 3 LLMs.

I was surprised that Claude was able to identify the language and explain the code.

But, please feel free to downvote my comments. I guess the aggregate in the end will demonstrate whether it was a useful comment or spam + bullshit GPT slop.

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

#77
post #75
post #65

Earlier quoted context omitted.

I cannot comprehend the mindset of people who decide to spam (because that is what your comment is) any forum with a page of bullshit GPT slop. Do you think it's helpful or interesting?

Personally I believe it is interesting since it shows the current state of the art for the 3 LLMs. I was surprised that Claude was able to identify the language and explain the code. But, please feel free to downvote my comments. I guess the aggregate in the end will demonstrate whether it was a useful comment or spam + bullshit GPT slop.

It wasn't able to explain the code, it was wrong.

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

#78

Earlier quoted context omitted.

"Debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" — Kernighan, Brian. The Elements of Programming Style (2e) . McGraw-Hill, 1978.

By becoming even more clever: https://www.linusakesson.net/programming/kernighans-lever/in...

Very unconvincing. If you become cleverer you can just write even more clever code and still not be able to debug it.

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

#79
post #36
post #32

"one line in your custom language" is not one line at all lol

To be fair K is a real language that's used by more than just him. Why array languages seem to gravitate to symbol soup that makes regex blush I'll never know.

Yeah I think MATLAB and Mathematica are waaay more used than K et al. They just don't look insane so people aren't posting them on HN as much.

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

#80

Earlier quoted context omitted.

Well no, not in a non-array programming language. In any language that has a semi-decent type/object system and some kind of functional programming support, `avg a+b` would just be `avg(a, b)`, which is not any easier or harder, with an array type defined somewhere. Once you make your basic array operations (Which they have to be made in q anyways, just in the stdlib), you can compose them just like you would in q, a…

Why would it be avg(a, b)? What if I want to take the average difference of two arrays?

mean(a - b)
Post reply on HN