tfib.nim 119 B

123456789101112
  1. iterator fibonacci(): int =
  2. var a = 0
  3. var b = 1
  4. while true:
  5. yield a
  6. var c = b
  7. b = a
  8. a = a + c