[[English Page]]~ [[Elementary Techniques]] | Techniques of Function | [[Techniques of Recursion]] | [[Techniques of Number]] #contents *Function of the form [1]X[2] [#g4076fa7] **Sample Code 1 [#j3ad53e2] a:rsl sassassasasaasasaasa (24B) [24B] The code above can be compressd by using a function. a:rsl f(X):sXa f()sf()sf()f()f()af()f()af() f(X):sXrsl f()f(f()f(f()f()f())f()f())f() (19B) [19B] **Sample Code 2 [#s843c0d9] x:rsl a:xxsxssxsxxxsxsla a (22B) [22B] x:rsl f(X):xXs a:f(f()f())f()xxf()f()la a By adding two extra "s", we can use rslXs function completely! x:rsl f(X):xXs a:f(f()f())f()xxf()f()lass a f(X):rslXs a:f(f()f())f()f(f(f()f()la)) a (19B) [19B] **Examples [#wf59f3bb] -[[Problem 0863]] -[[Problem 0864]] *Function of the form X[1]X [#jb2732e7] **Sample Code 1 [#yeab0151] f(X):XX a(X):f(f(f(f(XXr))r))a(srslX) a() [21B] f(X):XrX a(X):f(f(f(f(XX))r))a(f(s)lX) a() [20B] If we define a function "f(X):X[1]X", we have "f(f(X)) = X[1]X[1]X[1]X", ~ and this equals "(4 times X[1]) minus [1]". ~ **Sample Code 2 [#y7d41dad] f(X):XsssX f(f(rf(f(rsssssssssrsssrrsssr)))) f(X):XsssX f(f(rf(f(rf(f())f(r)f(r))))) Functions of the form "X[1]X" works like "double function". ~ Moreover, the function "XsssX" can make "sss" in 1B. ~ **Examples [#g596d286] -[[Problem 0804]] -[[Problem 0875]] *Function with many variables [#i4b374d3] **Sample Code 1 [#jabb8505] f(X,Y):XXXYY [8B] You can use f as double function, and as triple function. ~ This function definition costs less than a(X):XX b(X):XXX [7B] **Sample Code 2 [#ubcc5a0c] f(X,Y):XYXYYYX This function can be used -as "four times function", -as "three times function", -to make srsls ans slsrs (f(s,r) and f(s,l)).