|
|
Power 6/32 Unix version 1.21
c subroutine tst11 parameter(ntest=11) c Calls integer ack if ( ack(2,2) .ne. 7 ) call e(1,ntest) if ( ack(3,3) .ne. 61 ) call e(2,ntest) if ( ack(3,5) .ne. 253 ) call e(3,ntest) if ( ack(2,100) .ne. 203 ) call e(4,ntest) call fib0(10,i) if ( i .ne. 55 ) call e(5,ntest) call fib(15,i) if ( i .ne. 610 ) call e(6,ntest) call fib(20,i) if ( i .ne. 6765 ) call e(7,ntest) end integer function ack(m,n) if ( m.eq.0 )goto 1 if ( n.eq.0 )goto 2 ack = ack(m-1,ack(m,n-1)) return 1 ack = n+1 return 2 ack = ack(m-1,1) end subroutine fib0(a, b) c Fibonacci nrs integer a,b,f0,f1 f0=1 f1=1 i=2 entry fib(a, b) do 4 j=i+1,a b=f0+f1 f0=f1 f1=b 4 continue i=a end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.