#!/usr/local/bin/swift extension FizzBuzz : SequenceType { func generate() -> AnyGenerator { var n = 0 return AnyGenerator { if n == 100 {return nil} n += 1 return self[n] } } } let fizzbuzz = FizzBuzz() for s in fizzbuzz { print(s) }