Why Nostr? What is Njump?
2024-08-28 20:53:23
in reply to

M. Dilger on Nostr: Strange coincidence. I wrote a chess app on the weekend a few weeks ago because I ...

Strange coincidence. I wrote a chess app on the weekend a few weeks ago because I wanted to practice a bunch of Caro-Kann lines (I'm an aggressive player and I wanted to try to play defensive instead to expand my reperitoire).

The game state library imports/exports FEN or a series of algebraic moves. It uses bitboards and verifies legal moves, 'in check', etc, including en passant, castle rights, halfmove clock, etc.. the only major thing it doesn't do yet is determine checkmate (I just hadn't gotten that far in a weekend).

I got it plugged into stockfish and I can play against stockfish in a terminal. I didn't even get started on the gui.

Then I got it working beyind PyChess as an engine. The engine makes any of the "likely" Caro-Kann opponent moves and then I have to make the correct Caro-Kann response. This way I could practice those lines. If it gets into a state I didn't prepare for, it makes an illegal move to end the sequence.

Anyhow....
Even though I was able to write that rather quickly, I don't expect other nostr developers to write a chess engine for NIP-64. However, in order to display the chessboard from PGN notation, they will need to use a chess engine.... to either write one or to link to one... that makes each move specified one after another, each one validated, and then you end up with a board state.

It would be far easier for a nostr client to take a FEN and display the board state, because that is what a FEN is. Then nostr clients wouldn't need a chess engine inside of them.
Author Public Key
npub1acg6thl5psv62405rljzkj8spesceyfz2c32udakc2ak0dmvfeyse9p35c