/* $Id: factorial.pl,v 321.2 2002-03-06 17:50:09-08 - - $ */ /* * Factorial, the old intro to recursion standby. */ factorial( 0, 1 ) :- !. factorial( N, Nfac ) :- M is N - 1, factorial( M, Mfac ), Nfac is N * Mfac.