Skip to Content
Exploring Expect
book

Exploring Expect

by Don Libes
December 1994
Intermediate to advanced
606 pages
16h 7m
English
O'Reilly Media, Inc.
Content preview from Exploring Expect

Exercises

  1. 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)]

  2. 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.

  3. 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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI Agents in Action

AI Agents in Action

Micheal Lanham
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781565920903Supplemental ContentErrata Page