What is Nostr?
mikedilger /
npub1acg…p35c
2025-01-09 23:57:52

mikedilger on Nostr: I took a break from nostr over Christmas. First real break since I started working on ...

I took a break from nostr over Christmas. First real break since I started working on nostr. About 10 days worth. What did I do? I programmed chess.

There is a ton of chess related software out there. We shouldn't need more. Chess.com has become very popular, but I prefer lichess.org. Huge databases of games and puzzles, lessons to practice and learn, and online game matchmaking, tracking of Elo (or glicko-2) scores, etc.

Even 20 years ago there was way too much chess related software. Ok... there can't be "too much". What I mean is that there was a lot. Scroll down this page to see some of it: https://github.com/official-stockfish/Stockfish/wiki/Download-and-usage

So why did I want to write more? I had 100 reasons:

1. I didn't know of any that easily let me see which squares were controlled by which pieces, as a learning tool. It is probably out there but I didn't know about it.
2. I didn't know of any that let me learn opening lines by playing them against the computer where the computer first plays fixed moves to get to the beginning of the line, then choose random branches (based on random leafs) to play the opposition side of a line, and subsequently starts over or switches to stockfish.
3. I like the chess.com graphics, but I don't want to pay for their services. So I want to use those graphics even though they can't be distributed. Honestly I could have just shoved them into my pychess folder somewhere, but whatever
4. I like programming.

Anyhow, I have this cool set of libraries now that doesn't quite do what I set out to do, but almost does. I can play stockfish, or stockfish can play itself, or I can play myself. Originally I wrote a 'state' library and a 'uci' library and plugged in my server to pychess, my server being the one helping me practice and learn opening lines. But something about how pychess uses UCI wasn't quite working and often it would get stuck. So then I whipped up a 'gui' in egui (was super easy) and added nice things like drag and drop, opponent moves slide into place naturally. I want to add the "click" when they land. It has many sets of graphics to choose from and various ways to highlight squares and show messages and alert and things. I"ve also got an 'lmdb' crate where I store positions and responses, and indicate in the response if it is my Preferred response that I am trying to learn, or a bad move, or whatever (so I can learn the preferred moves for my strategic play... which are not necessarily the stockfish "best" moves).

I'm way to old to ever be good at chess though. But I can be better.

I haven't done any tie-in to nostr yet but that would be quite easy, and running this on a website won't be a huge lift either. So maybe NIP-64 could get expanded and implemented.
Author Public Key
npub1acg6thl5psv62405rljzkj8spesceyfz2c32udakc2ak0dmvfeyse9p35c