on fact (n) res = 1 repeat with i = 2 to n res = res*i end repeat return res end