Show HN: Conway's Game of Chess (gist.github.com)
Chess, but each square also follows the rules of Conway's Game of Life.
Only your own pieces count as neighbours when deciding births/deaths.
For births, an empty square must have 3 neighbours for 2 consecutive turns.
For deaths, a piece must have <2 or >3 neighbours for 3 consecutive turns.
This is a simple proof of concept I made with python and curses.
You can play with a friend locally or over a socket connection.
Controls: Arrow keys to move the cursor, enter/space to select and move a piece, u or backspace to undo a move, r to redo a move, q or escape to quit, s to perform a move with stockfish if installed (useless since it has no knowledge of this variant), any other key to unselect a currently selected piece.
21 comments
[ 2.6 ms ] story [ 177 ms ] threadI played a few games with myself, but noticed that the "Game over" message does not stop the game? Is it supposed to keep going after the king dies?
Also, I think some kind of legend would be very helpful. I was unsure what the lettering system meant, "w", "l", and "o". I get they are related to the rules, but was unsure what. I see in the code you have an epilog text, but I never saw that displayed when running the game, I think it would be helpful to see it while playing.
Finally, what rule dictates which pieces are born?
> I played a few games with myself, but noticed that the "Game over" message does not stop the game? Is it supposed to keep going after the king dies?
Game is over when that happens, I just didn't add in the logic to terminate or restart the game, so yes you can technically keep going.
> Also, I think some kind of legend would be very helpful. I was unsure what the lettering system meant, "w", "l", and "o". I get they are related to the rules, but was unsure what. I see in the code you have an epilog text, but I never saw that displayed when running the game, I think it would be helpful to see it while playing.
Good point, I just updated it to display before the game starts, before it would only show when running it with --help.
> Finally, what rule dictates which pieces are born?
There's a queue for each player which continuously loops over the list of pieces displayed, and they're popped from the queue to eligible squares starting from row 1 for white, and starting from row 8 for black, and from left to right.
I think it would be a bit easier to mentally manage than having every piece on its own count
Might give an edge to whoever goes second, because they will have more control on creating overpopulation conditions right before an update, which would offset first move advantage
I used curses simply because it was quick to experiment with since I had some similar code from another game I could reuse.
Still pretty cool though!
https://github.com/elesiuta/conways-game-of-chess