Hacker Newsnew | past | comments | ask | show | jobs | submit | quuxplusone's commentslogin

How do you mate with N+K? Surely your King can't give check, and if your Knight is giving check then the enemy king can just take a step toward it to get out of check.

Mentioned in TFA: This version of chess is given by Martin Gardner in his "Mathematical Games" column of July 1980 (pages 27 and 31) — https://www.jstor.org/stable/24966361 — and the analysis of White's mate is given in the column of August 1980 (page 18) — https://www.jstor.org/stable/24966383.

I do wonder how things would change if the board were 9 cells long; 10 cells long; etc. Also, it seems "in the spirit" to permit castling if neither K nor R has moved yet: i.e., from the position

K _ R N r _ n k

White ought to be permitted to

_ R K N r _ n k

(Or maybe there's a stronger argument for R K _ N r _ n k, actually. The former was conceptually "rook moves halfway toward king, then king moves to the other side of rook"; but the latter is "rook moves two steps in king's direction while king moves to the other side of rook.")

I'm pretty sure this wouldn't change the analysis on the 8-cell board at all, though. I wonder if it would change the analysis on any size of board.


Maybe I'm not good enough at chess to understand the strategy here, but how would castling be useful in this 1-D game? Castling in a normal game protects your King and activates the Rook. In this 1-D game, your King starts out protected behind the Rook. If you castle and end up in a _ R K N position, your king is exposed and your Rook is trapped behind the King, useless, with no way to ever get it back out. The Rook seems essential for mate, and its power has been eliminated.

Exactly. Feels like R K N would be a more suitable initial position in which castling would swap the king into safety, provided it has not moved and is not in check...

Though maybe in that case the best first move for both is to castle and we are non the wiser (back to the original starting position)



> I should own the fruits of my head like I own the fruits of my tree and they should remain property forever.

You're blindly assuming that in owning a thing now, you must naturally own it forever; that you can live forever in an eternal "now," like a child or an animal. But that's not how the natural world works, nor is it how the human world works. Supposing you own a particular tree; if you let the fruit from that tree fall to the ground and rot, you mustn't complain if someone else, picking up that fruit, saves it from rot.

Compare Schopenhauer, "The World as Will and Representation," IV.62:

> Take the case of an object that has been worked on, improved, or guarded and protected from mishap through someone’s efforts, however small, even if they amounted to no more than plucking or picking up some wild fruit from the ground: someone who seizes this object clearly deprives the other of the results of the energy he has expended on it; he is making the other’s body serve his will instead of its own [...] i.e. he is doing wrong. — On the other hand, simply enjoying something without doing any work on it or safeguarding it against destruction gives us as little right to the thing as the declaration of our will to be its sole owner. Thus, when a family has hunted by itself in a district for even a hundred years without having done anything towards its improvement, then this family cannot keep out a newcomer who wants to hunt there too without morally doing wrong. There is absolutely no moral ground for the so-called right of preoccupation, which holds that simply by virtue of having enjoyed a thing you can demand the exclusive right to its further enjoyment as an additional reward. The newcomer would have much more of a right to tell anyone whose claim rests merely on this right (the right of preoccupation): ‘the very fact that you have been enjoying it for so long makes it right that others should enjoy it now.’

Compare also Aesop:

> A Dog asleep in a manger filled with hay, was awakened by the Cattle, which came in tired and hungry from working in the field. But the Dog would not let them get near the manger, and snarled and snapped as if it were filled with the best of meat and bones, all for himself. The Cattle looked at the Dog in disgust. "How selfish he is!" said one. "He cannot eat the hay and yet he will not let us eat it who are so hungry for it!"


And, even more importantly, don't post it on April Fools Day! Delay gratification for 24 hours.

> This guy isn't a liberal

The intro paragraph threw me for a while, too. The author says he stopped liking Scott Alexander's posts because of the tenor of Scott's politics. Usually in the past couple decades when someone's said that it's meant "Scott's too Republican-coded for me on things like race and feminism"; but this post's author is actually arguing that Scott is too Democratic-coded for him on social issues like crime (and, by extension, immigration and race: TFA's author doesn't approve of the number of "obviously illegal" food trucks he sees on the street, for example).


The problem with that is that C++26 Contracts are just glorified asserts. They trigger at runtime, not compile time. So if your LLM-generated code would have worked 99% of the time and then crashed in the field... well, now it will work 99% of the time and (if you're lucky) call the contract-violation handler in the field.

Arguably that's better (more predictable misbehavior) than the status quo. But it's not remotely going to fix the problem with LLM-generated code, which is that you can't trust it to behave correctly in the corner cases. Contracts can't make the code magically behave better; all they can do is make it misbehave better.


In my experience, llms don't reason well about expected states, contracts, invariants, etc. Partly because that don't have long term memory and are often forced to reason about code in isolation. Maybe this means all invariants should go into AGENTS.md/CLAUDE.md files, or into doc strings so a new human reader will quickly understand assumptions.

Regardless, I think a habit of putting contracts to make pre- and post-conditions clear could help an AI reason about code.

Maybe instead of suggesting a patch to cover up a symptom, an AI may reason that a post-condition somewhere was violated, and will dig towards the root cause.

This applies just as well to asserts, too. Contracts/asserts actually need to be added to tell a reader something.


This headline seems editorialized, given that the URL just goes to maps.blitzortung.org, which makes no such claim (and AFAICT the map shows no unusual activity around Iran as of this particular instant either — maybe it did an hour ago, for all I know).

When NDEBUG is set, there is no test, no assertion, at all. So yes, this code has UB if you set NDEBUG and then pass it a null pointer — but that's obvious. The code does exactly what it looks like it does; there's no tricks or time travel hiding here.

TFA writes: "Late last year NPM was basically a skip fire" — is this an idiom I should know? (Something like a misfire?) Or a typo for "ship fire"? Or something else?

Skip is british term for dumpster.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: