DEV Community

Philip Braham
Philip Braham

Posted on

UMM plays chess

A UMM Chessboard
Universal Message Manager is a publish and subscribe system. So a sender of a message is detached from the receiver and the receiver is independent of the sender. So in a chess game we have these components:

  1. A chess board and the ability to move pieces. This is an html gui client.
  2. An agent (which is a UMM term for an application that sends or receives messages) to determine valid moves and to determine checkmate and other conditions. This is the legel-moves agent.
  3. An agent (which may the same as 2) to play a move. This is the chess-engine.

Agent 3 is optional if there are just two players

The game is run as follows:

  • A board sends a message with the initial state of the pieces
  • When a piece is touched a message is sent with the current position.
  • The legal-moves agent receives this message and sends a message with all the legal moves this piece can make. These options are then shown on the screen.
  • When a piece is moved the move is sent as a message.
  • If two players are playing, the other board receives this message, updates its screen and waits for return play.
  • If the other player is the chess-engine it receives the message and sends a message with its play.

The important point here is that playing a human or playing a machine is no different as far as the system is concerned.

Similarly, there can other boards set to simply show the current state of play and they update their pieces on the board when receiving the messages.

All these messages can be monitored and then played back. As far as a board is concerned the played back messages are identical to messages sent from another board or from the chess engine.

See online here: UMM plays chess

Top comments (0)