Skip to content

Instantly share code, notes, and snippets.

@regonn
Last active December 27, 2015 22:28
Show Gist options
  • Select an option

  • Save regonn/7398838 to your computer and use it in GitHub Desktop.

Select an option

Save regonn/7398838 to your computer and use it in GitHub Desktop.
def B(m,n)
if(m==0 && n>0)
return f(n)
end
if(m>0 && n==0 )
return B(m-1,1)
end
if(m>0 && n>0)
return B(m-1,B(m,n-1))
end
end
def f(n)
return n+1
end
def g(x)
return B(x,x)
end
puts g(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment