Skip to content

Instantly share code, notes, and snippets.

@sasagawa888
Created August 10, 2019 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasagawa888/b856302cb73eb422f29bddb85c59050f to your computer and use it in GitHub Desktop.
Save sasagawa888/b856302cb73eb422f29bddb85c59050f to your computer and use it in GitHub Desktop.
Elxlog ver0.05
?- X is elx_tarai(12,6,0).
X = 12
true
?-
def tarai(x, y, z) do
cond do
x <= y -> y
true -> tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment