Skip to content

Instantly share code, notes, and snippets.

@dahu
Created October 10, 2016 06:28
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 dahu/66989ec585654726b97bb4124deb9713 to your computer and use it in GitHub Desktop.
Save dahu/66989ec585654726b97bb4124deb9713 to your computer and use it in GitHub Desktop.
Ackerman function causes stack overflow in Red (and not Rebol)
Red []
; https://rosettacode.org/wiki/Ackermann_function
ack: func [m n] [
case [
0 = m [n + 1]
0 = n [ack m - 1 1]
true [ack m - 1 ack m n - 1]
]
]
;
repeat m 3 [
repeat n 6 [
print ack m n
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment