echo shore/samhunter/blog/2026/08/21.txt | nc nightfall.city 1900 | less
# 2026.08.21 / Friday
## Chess over Nex

Proof of Concept quality...

It's a really dumb client, it doesn't check the validity of moves.
- support for capture en passant should work;
- so should queen- and king-side castling.

I absolutely cannot guarantee there are no bugs (most probably there are, many).

Before someone complains about bashism -- it's a Bash script, that's where
bashisms live. Go away. Or - even better - write your own, POSIX-compliant
version and share it, that would be a win-win.

```
$ ./nex-chess -f shore/samhunter/chess.out shore/samhunter/chess.in
Loading game status...

  +---+---+---+---+---+---+---+---+
 8| ♖ | ♘ | ♗ | ♕ | ♔ | ♗ | ♘ | ♖ |
  +---+---+---+---+---+---+---+---+
 7| ♙ | ♙ | ♙ |   | ♙ | ♙ | ♙ | ♙ |
  +---+---+---+---+---+---+---+---+
 6|   |   |   |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 5|   |   |   | ♙ |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 4|   |   |   | ♟ |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 3|   |   | ♞ |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 2| ♟ | ♟ | ♟ |   | ♟ | ♟ | ♟ | ♟ |
  +---+---+---+---+---+---+---+---+
 1| ♜ |   | ♝ | ♛ | ♚ | ♝ | ♞ | ♜ |
  +---+---+---+---+---+---+---+---+
    a   b   c   d   e   f   g   h
Last move by b1c3
Your move [? for help]: b8-c6

  +---+---+---+---+---+---+---+---+
 8| ♖ |   | ♗ | ♕ | ♔ | ♗ | ♘ | ♖ |
  +---+---+---+---+---+---+---+---+
 7| ♙ | ♙ | ♙ |   | ♙ | ♙ | ♙ | ♙ |
  +---+---+---+---+---+---+---+---+
 6|   |   | ♘ |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 5|   |   |   | ♙ |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 4|   |   |   | ♟ |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 3|   |   | ♞ |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 2| ♟ | ♟ | ♟ |   | ♟ | ♟ | ♟ | ♟ |
  +---+---+---+---+---+---+---+---+
 1| ♜ |   | ♝ | ♛ | ♚ | ♝ | ♞ | ♜ |
  +---+---+---+---+---+---+---+---+
    a   b   c   d   e   f   g   h
Last move by you: b8c6
Send your move [y/n]? y
```

=> /shore/samhunter/code/nex-chess

1. save
2. make executable
3. start with
```
./nex-chess <your-nex-url> <their-nex-url>
```

for example if you're "foo" and your partner is "bar" (the actual URLs don't
matter, similar pattern used here only to make the difference clear:
```
./nex-chess shore/foo/chess.1234 shore/bar/chess.1234
```

"bar" (assuming they have the script too) replies by:
```
./nex-chess shore/bar/chess.1234 shore/foo/chess.1234
```

There's less fancy, regular version too (just don't use -f):
```
$ ./nex-chess  shore/samhunter/chess.in shore/samhunter/chess.out
Loading game status...

  +---+---+---+---+---+---+---+---+
 8| r |   | b | q | k | b | n | r |
  +---+---+---+---+---+---+---+---+
 7| p | p | p |   | p | p | p | p |
  +---+---+---+---+---+---+---+---+
 6|   |   | n |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 5|   |   |   | p |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 4|   |   |   | P |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 3|   |   | N |   |   |   |   |   |
  +---+---+---+---+---+---+---+---+
 2| P | P | P |   | P | P | P | P |
  +---+---+---+---+---+---+---+---+
 1| R |   | B | Q | K | B | N | R |
  +---+---+---+---+---+---+---+---+
    a   b   c   d   e   f   g   h
Last move: b8c6
Your move [? for help]:
```

### Closing thoughts
- I consider embedding the board visualisation in my homebrew browser. Instead
of starting a separate script it could just navigate to the game page and
render it. Adding a replay should be easy, then.

- It is probably possible to branch an already running game. No idea why would
anyone want it, but:

```
1. A starts a game with B:
A---B---A

2. C sees B's move and makes their own:
A---B---A---B
     `-C

3. B decides for some reason to play on two fronts
A---B---A---B---A---B
     `--C---B---C---B

4. A decides for some reason to try check other possibilites:
A---B---A---B---A---B---A
     `--C---B---C---B---C---B
                     `--A---C

```
Could be fun, could be a complete chaos :D