December 1994
Intermediate to advanced
606 pages
16h 7m
English
Write a procedure called bc which evaluates an arbitrary precision arithmetic expression (see page 229). The procedure should pass it to a bc process that has already been spawned and return the result so that it can used with other Tcl commands. For example:
set foo [bc 9487294387234/sqrt(394872394879847293847)]
Modify the chess script so that it keeps track of the time spent by each player and optionally halts the game if either player exceeds a time limit.
Named pipes allow unrelated processes to communicate. Write a script that creates a named pipe and writes a chess move to it. Write another script that opens the other end of the pipe and reads a chess move from it. Create another pipe so the scripts can communicate in the other direction as well.