Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // Coolest class ever
  2. class CoolGenerator: GeneratorType {
  3. typealias Element = String
  4.  
  5. let collCount: Int
  6. private var count: Int = 0
  7.  
  8. init( collCount: Int ) {
  9. self.collCount = collCount
  10. }
  11.  
  12. //Generates cool string
  13. func next() -> Element? {
  14.  
  15. count += 1
  16.  
  17. if count <= collCount {
  18. return "😎"
  19. }
  20.  
  21. return nil
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement