Lab 1: Tcl and OTcl Scripts

Exercise I: Fractorial Computation: tcl script to obtain the value of 10! = 10 * 9 * ... * 1.

  1. get lab1a.tcl and run the script;
  2. write a function to compute 2^x, test your answer.
Execute the script as:
$ tclsh lab1a.tcl
or
$ ns lab1a.tcl

Exercise II: Adding and Multiplying: Program in otcl to add or multiply two real numbers.

  1. get lab1b.tcl and run the script;
  2. add the function to multiply two real numbers;
  3. how to add or multiply two integers?
Execute the script as:

$ ns lab1b.tcl

References: