Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Coolest class ever
- class CoolGenerator: GeneratorType {
- typealias Element = String
- let collCount: Int
- private var count: Int = 0
- init( collCount: Int ) {
- self.collCount = collCount
- }
- //Generates cool string
- func next() -> Element? {
- count += 1
- if count <= collCount {
- return "😎"
- }
- return nil
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement