Skip to content

Instantly share code, notes, and snippets.

@sasagawa888
Created August 10, 2019 23:39
Show Gist options
  • Save sasagawa888/d9d62b46ca15b560f8d1a5dee0d4b0a8 to your computer and use it in GitHub Desktop.
Save sasagawa888/d9d62b46ca15b560f8d1a5dee0d4b0a8 to your computer and use it in GitHub Desktop.
tarai(X,Y,_,Y):-
X=<Y,!.
tarai(X,Y,Z,R):-
X1 is X-1,Y1 is Y-1,Z1 is Z-1,
tarai(X1,Y,Z,R1),tarai(Y1,Z,X,R2),tarai(Z1,X,Y,R3),tarai(R1,R2,R3,R).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment