annotate lab3/fac.p @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
mike@0 1 (* lab3/fac.p *)
mike@0 2
mike@0 3 proc fac(i);
mike@0 4 begin
mike@0 5 if i = 0 then
mike@0 6 return 1
mike@0 7 else
mike@0 8 return i * fac(i-1)
mike@0 9 end
mike@0 10 end;
mike@0 11
mike@0 12 begin
mike@0 13 print fac(10); newline
mike@0 14 end.
mike@0 15
mike@0 16 (*<<
mike@0 17 3628800
mike@0 18 >>*)