[[English Page]]~
Elementary Techniques | [[Techniques of Function]] | [[Techniques of Recursion]] | [[Techniques of Number]]


#contents

*Replace [#g0f68203]
**Sample Code [#offd467b]
 ssrsssslss
 (10B)

 a:ss
 araala 
 (9B)

**Examples [#y5e04adc]
-[[Problem 0208]]

*Loop [#t39d95ec]
**Sample Code [#ka869805]
 a:srsla
 a

Note that Loop can be recognized as a "recursive function with 0 variables".

**Examples [#oe29fdcc]
-[[Problem 0002]]

*Function [#jb31e524]
**Sample Code [#uea10e49]
 f(X):XXXXr
 f(f(f(ss))f(f(srsl))f(sr))
**Examples [#e1b9b788]
-[[Problem 0242]]

*Recursive function [#cee0f7fc]
**Sample Code 1[#uea10e49]
 a(X):XXa(rslsX)
 a(r)

**Sample Code 2[#uea10e49]
 f(X):XXXXr
 a(X):f(f(X))a(ssX)
 a(r)

It is sometimes important to use some auxiliary function in a recursive function.

**Sample Code 3[#uea10e49]
 a(X):sssXssXXXa(l)
 a(r)

"Not-growing" recursion is also important.~
This is 0-variables version of "special first term technique" in the [[Advanced Techniques 2]] Page.~
By the way, this code can be compressed by "multiple recursion" in the [[Advanced Techniques 2]] Page. 

**Examples [#e1b9b788]
-[[Problem 0007]]

*Recursive function with many variables [#gf79e44a]
**Sample Code 1[#uea10e49]
 a(X,Y):Xra(XY,X)
 a(,)

**Sample Code 2[#uea10e49]
 a(X,Y):Xa(YrXYl,sY)
 a(r,)

**Examples [#e1b9b788]
-[[Problem 0030]]
-[[Problem 0276]]

*Function with a number [#m65d04f9]
-"FUNCTION(non-positive number)" vanishes.
-You can't use numbers greater than 255.

**Sample Code 1[#uea10e49]
 a(T):sa(T-1)
 a(11)ra(15)ra(13)l
 [15B]

 a(T):sa(T-1)l
 a(11)a(15)a(13)
 [13B]

**Sample Code 2[#uea10e49]
 a(X,T):Xra(sX,T-1)a(,5)
 a(,10)

**Sample Code 3[#uea10e49]
 a(X,T):sXa(lsrXrsl,T-1)Xs
 a(,10)

Note that the "most-grown-terms" appears in the middle.

**Examples [#s91d5a82]
-[[Problem]]
-[[Problem]]


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS