home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 018.lha / examples / fib.st < prev    next >
Text File  |  1986-10-19  |  246b  |  13 lines

  1. Class Fib :Generator
  2. | lastNumber  nextToLastNumber |
  3. [
  4.     first
  5.             nextToLastNumber <- 0.
  6.             ^ lastNumber <- 1
  7. |
  8.       next            | sum |
  9.             sum <- nextToLastNumber + lastNumber.
  10.             nextToLastNumber <- lastNumber.
  11.             ^ lastNumber <- sum
  12. ]
  13.