archie/tcl-dp/examples/tictactoe/README

44 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-05-27 16:13:40 +02:00
Tcl-DP: Tic Tac Toe
This creates a simple distributed Tic Tac Toe game, displayed using
Tk widgets. It is an example of using a Tcl-DP distributed object.
playerX.tcl -- script for player X, must be run first
playerO.tcl -- script for player O, must be run after playerX.tcl
The following two files are shared by player X and player O.
board.tcl -- definition of the distributed board class
interface.tcl -- definition of user interface of Tk widgets
--------------------------------------------------------------------
First, start player X...
Run wish.
Type "source playerX.tcl" and answer the questions;
--------------------------------------------------------------------
Second, start player O...
Run wish, as another process.
Type "source playerO.tcl" and answer the questions;
--------------------------------------------------------------------
Player X is the RPC server. Player O is the RPC client. (Hence,
player X must be set up before player O.) Player X creates a Tic
Tac Toe board object, which gets distributed to player O. Each
player process locally updates its Tk interface, as the Tk
widgets of the interface are not distributed objects.
Because the board is a distributed object, callbacks from user
actions are very simple. Any changes to slots of the board
object in a callback are automatically propagated to all
processes.