Data update
This commit is contained in:
parent
07c7092a52
commit
61b93a2cd1
313 changed files with 6160 additions and 346 deletions
|
|
@ -0,0 +1,14 @@
|
|||
100 for m = 0 to 4
|
||||
110 print using "###";m;
|
||||
120 for n = 0 to 6
|
||||
130 if m = 4 and n = 1 then goto 160
|
||||
140 print using "######";ack(m,n);
|
||||
150 next n
|
||||
160 print
|
||||
170 next m
|
||||
180 end
|
||||
190 sub ack(m,n)
|
||||
200 if m = 0 then ack = n+1
|
||||
210 if m > 0 and n = 0 then ack = ack(m-1,1)
|
||||
220 if m > 0 and n > 0 then ack = ack(m-1,ack(m,n-1))
|
||||
230 end sub
|
||||
18
Task/Ackermann-function/True-BASIC/ackermann-function.basic
Normal file
18
Task/Ackermann-function/True-BASIC/ackermann-function.basic
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
FUNCTION ack(m, n)
|
||||
IF m = 0 THEN LET ack = n+1
|
||||
IF m > 0 AND n = 0 THEN LET ack = ack(m-1, 1)
|
||||
IF m > 0 AND n > 0 THEN LET ack = ack(m-1, ack(m, n-1))
|
||||
END FUNCTION
|
||||
|
||||
FOR m = 0 TO 4
|
||||
PRINT USING "###": m;
|
||||
FOR n = 0 TO 8
|
||||
! A(4, 1) OR higher will RUN OUT of stack memory (default 1M)
|
||||
! change n = 1 TO n = 2 TO calculate A(4, 2), increase stack!
|
||||
IF m = 4 AND n = 1 THEN EXIT FOR
|
||||
PRINT USING "######": ack(m, n);
|
||||
NEXT n
|
||||
PRINT
|
||||
NEXT m
|
||||
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue