Skip to content

Instantly share code, notes, and snippets.

@pablq
Created March 10, 2016 23:44
Show Gist options
  • Save pablq/400c3785d4dabc397977 to your computer and use it in GitHub Desktop.
Save pablq/400c3785d4dabc397977 to your computer and use it in GitHub Desktop.
/* wow */
factorial(0,1).
factorial(n,f) :-
n>0,
n1 is n-1,
factorial(n1,f1),
f is n * f1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment