24 lines
635 B
Plaintext
24 lines
635 B
Plaintext
100 sub f(n,x,y)
|
|
110 if n = 0 then f = x+y : exit sub
|
|
120 if y = 0 then f = x : exit sub
|
|
130 f = f(n-1,f(n,x,y-1),f(n,x,y-1)+y)
|
|
140 end sub
|
|
150 for n = 0 to 1
|
|
160 print using " Values of F(#, x, y ):";n
|
|
170 print " y/x 0 1 2 3 4 5"
|
|
180 print " -----------------------------"
|
|
190 for y = 0 to 6
|
|
200 print y;" |";
|
|
210 for x = 0 to 5
|
|
220 print using "####";f(n,x,y);
|
|
230 next x
|
|
240 print
|
|
250 next y
|
|
260 print
|
|
270 next n
|
|
280 print "F(0,0,0) = ";f(0,0,0)
|
|
290 print "F(1,3,3) = ";f(1,3,3)
|
|
300 print "F(2,1,1) = ";f(2,1,1)
|
|
310 print "F(3,1,1) = ";f(3,1,1)
|
|
320 print "F(2,2,1) = ";f(2,2,1)
|