Lab 1: Tcl and OTcl Scripts
Exercise I: Fractorial Computation:
tcl script to obtain the
value of 10! = 10 * 9 * ... * 1.
- get lab1a.tcl and run the script;
- 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.
- get lab1b.tcl and run the script;
- add the function to multiply two real numbers;
- how to add or multiply two integers?
Execute the script as:
$ ns lab1b.tcl
References: