proc fac(n) { var r = 1; for i in 1..n do r *= i; return r; }