def factorial (int n) decl int z set z 1 if (> n 1) set z (* n (factorial (- n 1))) end if return z end