News for hackers. Stuff that matters.
Re:Blunder Free Chess – visualize which squares are attacked by primitivesuave on Tuesday February 25, 2025 @12:36PM (#43174901)
I'm curious as to why you wrote your own chess implementation - seems like this would have been much easier to implement with chessboard.js [1] and chess.js [2].

1. https://chessboardjs.com/

2. https://github.com/jhlywa/chess.js/blob/master/README.md

Re:Blunder Free Chess – visualize which squares are attacked by mkoryak on Tuesday February 25, 2025 @12:38PM (#43174926)
They wrote their own because it's more fun to do that, and also because they really wanted me to win. The computer is really really bad
Re:Blunder Free Chess – visualize which squares are attacked by lucb1e on Tuesday February 25, 2025 @01:07PM (#43175250)
Hey now, I was proud to have won from a chess computer for once!
Re:Blunder Free Chess – visualize which squares are attacked by alabastervlog on Tuesday February 25, 2025 @02:15PM (#43176057)
Glad I'm not the only one who often can't beat even the "easy" computer opponent in chess programs.

The main problem is that I only win by having my extremely-stupid blunders overlooked and then spotting my opponent's extremely-stupid blunder, so if the computer never misses my boneheaded blunders and also almost never commits any exploitable-in-one-or-rarely-two-moves blunders of their own, I can't possibly win, zero chance.

Re:Blunder Free Chess – visualize which squares are attacked by renox on Tuesday February 25, 2025 @02:52PM (#43176463)
ROFL you're right that the computer is really bad, I won in 7 round which is a first for me (against a computer) and I'm bad at chess.

It reminds of a reversi I made for a school projects: users liked it because the computer was so bad that they could win..

Re:Blunder Free Chess – visualize which squares are attacked by bavarianbob on Tuesday February 25, 2025 @03:05PM (#43176624)
Surprisingly, in this context, I frequently came across interfaces that make it difficult to implement certain features using those libraries. There's not a one-size-fits-all implementation yet.
Re:Blunder Free Chess – visualize which squares are attacked by logicallee on Tuesday February 25, 2025 @02:03PM (#43175928)
>I'm curious as to why you wrote your own chess implementation

I was investigating whether AI can write a complete game of chess in one shot, I livestreamed that here[1] and the answer is no (conclusion: major rules are there, but buggy), but I was able to get it into a working state after many hours of back and forth.

The original implementation froze whenever a pawn got to the seventh rank, and allowed castling out of and through check (illegal), it was very buggy.

Iterating with the AI, I added tons of stuff like drag to move pieces, mobile support, and, yes, computer play. When that was finished (it is available at: https://taonexus.com/chess.html ) I had it make this blunder-free variant and it got it pretty fast.

[1] https://www.youtube.com/watch?v=AhJ07anVkYk