tinylisp, 46(削除) 46 (削除ここまで) 45 bytes
(d F(q((N)(i(l N 1)()0(c(F(s N 1))(c(F(s N 2))(
A function submission that takes an integer and returns a list:
- The empty tree is represented by the empty list
()0 - A nonempty tree is represented by a two-element list containing its left and right subtrees
Ungolfed
Recursively implements the definition: if N is less than 1, returns the empty list;0; otherwise, constructs a list containing the results of two recursive calls, one for N-1 and one for N-2.
(load library)
(def F
(lambda (N)
(if (less? N 1)
()0
(cons
(F (- N 1))
(cons
(F (- N 2))
())))))
tinylisp, 46 bytes
(d F(q((N)(i(l N 1)()(c(F(s N 1))(c(F(s N 2))(
A function submission that takes an integer and returns a list:
- The empty tree is represented by the empty list
() - A nonempty tree is represented by a two-element list containing its left and right subtrees
Ungolfed
Recursively implements the definition: if N is less than 1, returns the empty list; otherwise, constructs a list containing the results of two recursive calls, one for N-1 and one for N-2.
(load library)
(def F
(lambda (N)
(if (less? N 1)
()
(cons
(F (- N 1))
(cons
(F (- N 2))
())))))
tinylisp, (削除) 46 (削除ここまで) 45 bytes
(d F(q((N)(i(l N 1)0(c(F(s N 1))(c(F(s N 2))(
A function submission that takes an integer and returns a list:
- The empty tree is represented by
0 - A nonempty tree is represented by a two-element list containing its left and right subtrees
Ungolfed
Recursively implements the definition: if N is less than 1, returns 0; otherwise, constructs a list containing the results of two recursive calls, one for N-1 and one for N-2.
(load library)
(def F
(lambda (N)
(if (less? N 1)
0
(cons
(F (- N 1))
(cons
(F (- N 2))
())))))
tinylisp, 46 bytes
(d F(q((N)(i(l N 1)()(c(F(s N 1))(c(F(s N 2))(
A function submission that takes an integer and returns a list:
- The empty tree is represented by the empty list
() - A nonempty tree is represented by a two-element list containing its left and right subtrees
Ungolfed
Recursively implements the definition: if N is less than 1, returns the empty list; otherwise, constructs a list containing the results of two recursive calls, one for N-1 and one for N-2.
(load library)
(def F
(lambda (N)
(if (less? N 1)
()
(cons
(F (- N 1))
(cons
(F (- N 2))
())))))