langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
20
Task/Mutual-recursion/REBOL/mutual-recursion.rebol
Normal file
20
Task/Mutual-recursion/REBOL/mutual-recursion.rebol
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
REBOL [
|
||||
Title: "Mutual Recursion"
|
||||
Date: 2009-12-14
|
||||
Author: oofoe
|
||||
URL: http://rosettacode.org/wiki/Mutual_Recursion
|
||||
References: [http://en.wikipedia.org/wiki/Hofstadter_sequence#Hofstadter_Female_and_Male_sequences]
|
||||
]
|
||||
|
||||
f: func [
|
||||
"Female."
|
||||
n [integer!] "Value."
|
||||
] [either 0 = n [1][n - m f n - 1]]
|
||||
|
||||
m: func [
|
||||
"Male."
|
||||
n [integer!] "Value."
|
||||
] [either 0 = n [0][n - f m n - 1]]
|
||||
|
||||
fs: [] ms: [] for i 0 19 1 [append fs f i append ms m i]
|
||||
print ["F:" mold fs crlf "M:" mold ms]
|
||||
Loading…
Add table
Add a link
Reference in a new issue