home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d811 / bsh.lha / bsh / ack < prev    next >
Text File  |  1993-02-14  |  511b  |  18 lines

  1. echo $argv
  2. if $#!=3
  3. echo usage $0 num1 num2
  4. elseif $1==0
  5. return $2+1
  6. elseif $2==0
  7. return ack($1-1,1)
  8. else
  9. return ack($1-1,ack($1,$2-1))
  10. endif
  11. # ack - Ackermann's function.  Don't use large parameters; it may exceed the
  12. # source-file nesting limit.  To run, type
  13. #            eval ack (2,2)
  14. # Ack is presented as is; no warrantee is either expressed or implied
  15. # as to it's suitability to any purpose whatsoever.  You assume all the
  16. # risk for all damage even if caused by a defect in the software, no matter
  17. # how awful
  18.